From: <bg...@fr...> - 2002-10-16 09:44:57
|
En réponse à john <jo...@pr...>: > > > Is it possible to run a Linux command from within a cobol program with > Tiny > Cobol. > > Ex: > call "system" using cmd status. > > > 01 cmd pic x(30) value "ls -l >temp" > 01 status pic s9999 comp. > Yes, but do not forget that: 1) you are calling C code (i.e. strings must be null terminated) 2) if you are calling a function like system you must use RETURNING to get the result. So your code should look like : 01 cmd. 05 filler pic x(30) value "ls -l >temp". 05 filler pic x value low-value. 01 status pic s9999 comp. and call "system" using cmd returning status. See examples of calling C code in test_suite/call_tests/ptest02.cob and stest9xx.c. > Regards > > John Kennedy > Hope this helps, Bernard Giroud |