CDS180
System Call |
Last Revised: 06/19/13 |
This program is used to execute an operating system command. It functions on both Unix and Windows systems, and can also be used to execute a command across a pro5 or bbj data server, and on a bbj thin client workstation.
It is recommended to use this routine instead of using the bbx SCALL function, since it can capture any error messages and display them and return these messages to the calling program.
Calling format:
CALL "CDS180", ERR=LABEL, CMD$,{ S180$, EX, ERRTXT$ }
CDS180 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
LABEL | Line to branch to if the execution is unsuccessful. The ERR
variable will be set to 199. |
||||||||||||||
CMD$ | The command to be executed. On Windows systems CDS180 will add the appropriate command processor as required. | ||||||||||||||
S180$ |
|
||||||||||||||
EX | The exit status code. Many commands, especially on unix systems generate an exit status or result code. This code is typically zero if the command was successful. If unsuccessful, then the exit status code may indicate the reason for the error. | ||||||||||||||
ERRTXT$ | Any text output created by the command is returned to the calling program in this variable. |
Example |
2380 CALL "CDS180",ERR=2510,"tar cf - "+S187.RELNAME$+" | gzip
> "+TARFILE$,"YS",EX,ERRTXT$
|
Example |
3480 CALL "CDS180",ERR=3500,"gzip -dc "+TARFILE$+" | tar "+TARDIR$+"-xf
-","YS",EX,ERRTXT$
|