#include <as400_protos.h> int systemCL(const char *command, int flags);
Note: This function can only be used in an i5/OS PASE program. See i5/OS PASE for more information about creating i5/OS PASE programs.
The systemCL() function runs a CL command.
SYSTEMCL_MSG_STDOUT (0x00000001) | Directs the system to receive i5/OS messages
after normal command completion, convert the text of each message from the job
default CCSID to the i5/OS PASE CCSID, and write converted text lines to
Integrated File System descriptor 1 (stdout). |
SYSTEMCL_MSG_STDERR (0x00000002) | Directs the system to receive i5/OS messages
after error command completion, convert the text of each message from the job
default CCSID to the i5/OS PASE CCSID, and write converted text lines to
Integrated File System descriptor 2 (stderr). |
SYSTEMCL_MSG_NOMSGID (0x00000004) | Suppresses message identifiers in text lines
written to stdout or stderr for messages processed on behalf of
SYSTEMCL_MSG_STDOUT and SYSTEMCL_MSG_STDERR. When this option is omitted,
message text lines have the form "XXX1234: message text", where "XXX1234" is
the i5/OS message identifier. |
SYSTEMCL_SPOOL_STDOUT (0x00000008) | Directs the system to process any spooled output
files created by the CL command by reading each file, converting file data from
the job default CCSID to the i5/OS PASE CCSID, and writing converted text
lines to Integrated File System descriptor 1 (stdout). |
SYSTEMCL_SPOOL_KEEP (0x00000010) | Directs the system to keep any spooled output
files after they are processed for option SYSTEMCL_SPOOL_STDOUT, instead of
deleting the files after their contents is written to stdout. |
SYSTEMCL_FILTER_STDIN (0x00000020) | Directs the system to setup a filter thread that
converts from the i5/OS PASE CCSID to the job default CCSID for any data the
CL command reads from Integrated File System descriptor 0 (stdin). |
SYSTEMCL_FILTER_STDOUT (0x00000040) | Directs the system to setup a filter thread that
converts any data the CL command writes to Integrated File System descriptor 1
(stdout) from the job default CCSID to the i5/OS PASE CCSID. |
SYSTEMCL_FILTER_STDERR (0x00000080) | Directs the system to setup a filter thread that
converts any data the CL command writes to Integrated File System descriptor 2
(stderr) from the job default CCSID to the i5/OS PASE CCSID. |
SYSTEMCL_SPAWN (0x00000100) | Directs the system to run the CL command in a
separate process. If this option is omitted, the CL command runs in the process
that calls the systemCL function. |
SYSTEMCL_SPAWN_JOBLOG (0x00000200) | Forces the system to generate an i5/OS job log
for the job submitted using option SYSTEMCL_SPAWN. |
SYSTEMCL_ENVIRON (0x00000400) | Directs the system to copy i5/OS PASE environment variables to ILE environment variables before running the CL command. This option sets ILE environment variables in the process that calls the systemCL function, regardless of whether the command runs in this process or a child process (created for option SYSTEMCL_SPAWN). |
No authority is needed to run the systemCL function, but the caller must be authorized to run the specified CL command.
If the command argument is a null pointer, the function result is zero if system support to call the i5/OS Command Analyzer is available, or a nonzero value otherwise.
If option SYSTEMCL_SPAWN is specified, the function result is the exit code from the spawned job (returned by the ILE waitpid function), which is non-zero if any error occurred.
Otherwise, the function result is zero for normal command completion, or -1 if an error occurred. No errno value is set for CL command errors.
Top | i5/OS PASE APIs | APIs by category |