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$
(1,1) Display Error Message
"Y"Display any error message generated by the command in a window. Ignored if running in a background task without a display device.
"N"Do not display any error messages. This is the default value.
(2,1) Execution Location
"S"Execute using SCALL(), this is the default value.  This is the server that is running the bbx or bbj interpreter, or the Windows PC if running VPro5.
"D"Execute on data server specified in SMSDIR. Same as "S" option if SMSDIR does not include data server syntax.
"C"Execute on bbj thin client, i.e., on workstation. Same as "S" if not running bbj thin client.
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$