1751873 Members
5111 Online
108782 Solutions
New Discussion

Unix - Cobol

 
Sathish C
Frequent Advisor

Unix - Cobol

Is it possible to pass an argument to an Unix system call command in Cobol .

Ex

Inside cobol

EXHIBIT NAMED WS02-OUTPUT-FILE-NAME.
call "system" using by reference 'll WS02-OUTPUT-FILE-NAME" GIVING AR02-STATUS
Some cause happiness wherever they go; others, whenever they go
1 REPLY 1
Jean-Luc Oudart
Honored Contributor

Re: Unix - Cobol

We use it this way
CALL 'SYSTEM' USING WSAA-CMD

with :
01 WSAA-CMD.
03 FILLER PIC X(8) VALUE ' 03 FILLER PIC X VALUE x'00'.

You can also trp the return code :

CALL 'SYSTEM' USING WSAA-CMD RETURNING return-code
The type for return code is explained in tge Cobol reference manual.

Regards,
Jean-Luc
fiat lux