Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OS calls in IBM Visual Age Cobol for AIX 1

Status
Not open for further replies.

mrobbo

Programmer
Sep 26, 2000
7
GB
Is it possible to make a call to the Operating System (ie AIX) using IBM's Visual Age for Cobol. I would like to be able to execute a script from within a Cobol program.

Cheers,
Robbo.
 
Try this:

WORKING-STORAGE SECTION.
01 MY-RUN-COMMAND.
10 MY-RUN-NAME PIC X(30).
10 FILLER PIC X VALUE X"00".

PROCEDURE DIVISION.
MOVE "myscript.sh" TO MY-RUN-NAME.
CALL "SYSTEM" USING MY-RUN-COMMAND.

Good luck!
bill [sig][/sig]
 
okay, I've done this and the program comiles OK but then fails at the link step "Undefined symbol .SYSTEM". Am I missing somthing in my environment setup?

Mark

P.S. This is the IBM Cobol Set for AIX version 1.1 [sig][/sig]
 
Sorry,

maybe "SYSTEM" is specific to Microfocus. I don't know of another way. Unless you can call a 'C' function from your cobol. In that case you could call the system() function...or call a C program that then calls system()?

bill

[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top