# Compile and Exe

**URL:** <https://techcommunity.softwareag.com/t/compile-and-exe/75759>\
**Category:** Forum\
**Tags:** Adabas-Natural, Natural, Natural-News-and-General-Topics, Natural-on-Windows-Unix\
**Created:** [November 27, 2007, 12:25pm UTC](https://techcommunity.softwareag.com/t/compile-and-exe/75759 "2007-11-27T12:25:30Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![joy\_deep](https://avatars.discourse-cdn.com/v4/letter/j/e68b1a/32.png) [@joy\_deep](https://techcommunity.softwareag.com/u/joy_deep)\
**Post date:** [November 27, 2007, 12:25pm UTC](https://techcommunity.softwareag.com/t/compile-and-exe/75759/1 "2007-11-27T12:25:30Z")

</div>

Hi,

I am using Natural 6.2.3 on Windows 2000. How do I compile a Natural ADABAS program from command line? Also, Can I execute the program from the command line? How do I pass command line arguments to the program?

Thanks,  
Joydeep Chakrabarty

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [November 27, 2007, 12:46pm UTC](https://techcommunity.softwareag.com/t/compile-and-exe/75759/2 "2007-11-27T12:46:32Z")

</div>

[url][http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat632win/ops/ops-batchmode.htm[/url]](http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat632win/ops/ops-batchmode.htm%5B/url%5D)

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [November 27, 2007, 5:38pm UTC](https://techcommunity.softwareag.com/t/compile-and-exe/75759/3 "2007-11-27T17:38:34Z")

</div>

Joydeep;

It was not clear from your question whether you meant “batch Mode”, which Wolfgang answered, or interactive mode.

In interactive mode you would simply:

STOW PGM01 to compile the current program in the editor

EXECUTE PGM01 (or just PGM01) to execute a STOW’ed program PGM01

RUN to compile and execute the current program in the editor

PGM01 ABC to execute PGM01 and place the string ABC on the top of the Stack.  
The first INPUT statement in PGM01 will read the ABC.

steve

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [November 27, 2007, 5:40pm UTC](https://techcommunity.softwareag.com/t/compile-and-exe/75759/4 "2007-11-27T17:40:20Z")

</div>

Just another comment; there are icons to click for commands like STOW, RUN, EXECUTE, etc, which are much easier to use than the Command Line.

steve

---

<div class="post-metadata">

**Author:** ![joy\_deep](https://avatars.discourse-cdn.com/v4/letter/j/e68b1a/32.png) [@joy\_deep](https://techcommunity.softwareag.com/u/joy_deep)\
**Post date:** [November 28, 2007, 2:54pm UTC](https://techcommunity.softwareag.com/t/compile-and-exe/75759/5 "2007-11-28T14:54:17Z")

</div>

I think I was not very clear in my question.  
I have a Natural program. abcd.NSP. Can this program be compiled and run from outside the Natural environment. Say, can I compile this program from C:\ - Windows command line? I do not want to compile and run from the editor.

Thanks,  
Joydeep

---

<div class="post-metadata">

**Author:** ![Steve\_Robinson](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/steve_robinson/32/107_2.png) [@Steve\_Robinson](https://techcommunity.softwareag.com/u/Steve_Robinson)\
**Post date:** [November 28, 2007, 5:11pm UTC](https://techcommunity.softwareag.com/t/compile-and-exe/75759/6 "2007-11-28T17:11:05Z")

</div>

Ah, the Windows Command Line, not the Natural Command Line.

Follow the link that Wolfgang Winter posted to the discussion of running Natural in Batch on the PC

steve

---

<div class="post-metadata">

**Author:** ![Weihnachtsbar](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/weihnachtsbar/32/146_2.png) [@Weihnachtsbar](https://techcommunity.softwareag.com/u/Weihnachtsbar)\
**Post date:** [November 28, 2007, 7:42pm UTC](https://techcommunity.softwareag.com/t/compile-and-exe/75759/7 "2007-11-28T19:42:27Z")

</div>

joy\_deep wrote:

> [@](#):
>
> I have a Natural program. abcd.NSP. Can this program be compiled and run from outside the Natural environment.

Yes - but you need a fully installed Natural.

joy\_deep wrote:

> [@](#):
>
> Say, can I compile this program from C:\ - Windows command line?

Yes - Not trivial. :twisted:

Your Program ABCD.NSP (please all uppercase!!) has to belong to a Natural library, which means:  
1st It must be saved a the correct place, for example:

```auto
 ...\Software AG\Natural\Natapps\Fuser\MYLIBRARY\SRC\ABCD.NSP
```

2nd It is necessary that the file is defined at FILEDIR.SAG, which can be forced with the FTOUCH Utility, which is a little complicated to use. Search for “FTOUCH” this at your online documentation and follow the instructions.

Now you can open a dos prompt at your directory:

```auto
...\Software AG\Natural\6.3\Bin
```

and run:

```auto
natural stack=(logon mylibrary;e abcd;stow;fin)
```

and your program will be stowed. 🙂

or:

```auto
natural stack=(logon mylibrary;run abcd;fin)
```

and your program will run. 8)

or:

```auto
natural stack=(logon mylibrary;abcd;fin)
```

and your program will be executed (if you previously stowed it). 😉

:roll: But I think you don’t like it at the end…

---

<div class="post-metadata">

**Author:** ![Douglas\_Kelly](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/douglas_kelly/32/102_2.png) [@Douglas\_Kelly](https://techcommunity.softwareag.com/u/Douglas_Kelly)\
**Post date:** [November 28, 2007, 8:27pm UTC](https://techcommunity.softwareag.com/t/compile-and-exe/75759/8 "2007-11-28T20:27:23Z")

</div>

> [@](#):
>
> Code:  
> natural stack=(logon mylibrary;e abcd;stow;fin)

should read

```auto

natural stack=(logon mylibrary;read abcd;stow;fin) 
```

(“read” not “e” (edit) on the STACK)

---

<div class="post-metadata">

**Author:** ![Weihnachtsbar](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/weihnachtsbar/32/146_2.png) [@Weihnachtsbar](https://techcommunity.softwareag.com/u/Weihnachtsbar)\
**Post date:** [November 29, 2007, 12:38pm UTC](https://techcommunity.softwareag.com/t/compile-and-exe/75759/9 "2007-11-29T12:38:08Z")

</div>

Douglas Kelly wrote:

> [@](#):
>
> natural stack=(logon mylibrary;read abcd;stow;fin)

Or better, to avoid locking conflicts, if the file is opened with another editor:

```auto
natural : stack=(logon mylibrary;read abcd;cat;fin)
```

and the : to suppress the startup screen 😉

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 2:48pm UTC](https://techcommunity.softwareag.com/t/compile-and-exe/75759/10 "2021-04-02T14:48:57Z")

</div>


