Compile and Exe

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

[url]http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat632win/ops/ops-batchmode.htm[/url]

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

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

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

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

joy_deep wrote:

Yes - but you need a fully installed Natural.

joy_deep wrote:

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:

 ...\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:

...\Software AG\Natural\6.3\Bin

and run:

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

and your program will be stowed. :slight_smile:

or:

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

and your program will run. 8)

or:

natural stack=(logon mylibrary;abcd;fin)

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

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

should read


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

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

Douglas Kelly wrote:

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

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

and the : to suppress the startup screen :wink: