Running the RUNX Utility
You can execute the RUNX utility program in the following ways:
-
Using a RUN command in a CANDE or MARC session, in a WFL job, or at an ODT.
The RUN command must be of the form RUN *SYSTEM/RUNX("<command line>").
-
Using the WFL RUNX command.
-
Using the CANDE RUNX command.
A user must have PU privileges to use the RUNX utility, unless the security administrator status (??SECAD) is authorized on the system. If the security administrator status is authorized on the system, a usercode must have SECADMIN privileges to use the RUNX utility.
The RUNX utility also requires a valid NXSERVICES credentials file to securely access the external system. For details on creating a credentials file, refer to MAKECREDENTIALS Utility.
Input Options
The <command line> input to the RUNX utility identifies the external program to be run along with any command line parameters for that program.
EXMODE File Attribute
EXMODE (External Translation Mode) specifies the type of data translation to be performed by the RUNX utility.
Syntax
── EXMODE ─── = ───┬──<exmode mnemonic>──┬──────────────────────┤ └──<numeric value>────┘
Values
Mnemonic |
Value |
Description |
---|---|---|
NONE |
0 |
No data translation |
ALL |
1 |
All data translated |
Description
You can specify an EXMODE value for STDIN, STDOUT, or STDERR using standard file equation using the IOHSTRING file attribute.
Example
RUN *SYSTEM/RUNX("cmd.exe") ;FILE STDIN(IOHSTRING="EXMODE=ALL") ;FILE STDOUT(IOHSTRING="EXMODE=1") ;FILE STDERR(IOHSTRING="EXMODE=NONE")
EOLTRANS File Attribute
EOLTRANS (End of Line Transformation) specifies what type of processing the RUNX utility should perform at the end of each line of output. This attribute only applies to STDOUT and STDERR files.
Syntax
── EOLTRANS ─── = ─────<boolean value>────────────────────────────┤
Values
Mnemonic |
Value |
Description |
---|---|---|
FALSE |
1 |
Does not perform end of line transformation. |
TRUE |
2 |
Transforms all end of lines to include a CRLF pair. |
Description
You can specify EOLTRANS for STDOUT and STDERR using standard file equation using the IOHSTRING file attribute.
TEXTIN File Attribute
The TEXTIN file attribute specifies the amount of information that should be included when processing record-oriented text files. The TEXTIN attribute is only applicable to STDIN.
Syntax
── TEXTIN ─── = ───┬──<texin mnemonic>───┬──────────────────────┤ └──<numeric value>────┘
Values
Mnemonic |
Value |
Description |
---|---|---|
ALL |
1 |
Sends all data (text, line number, and mark ID) |
TEXTONLY |
2 |
Only sends the textual portion of each record. This is the default value. |
Example
RUN *SYSTEM/RUNX("cmd.exe") ;FILE STDIN(IOHSTRING="TEXTIN=TEXTONLY.")
Examples
The following example runs cmd.exe as an external process:
RUN *SYSTEM/RUNX(“cmd.exe /c echo ‘hello’”)
The following example runs cmd.exe as an external process. Output from the program is directed to the file DIR.TXT:
RUN *SYSTEM/RUNX(“cmd.exe /c dir c:\”); FILE STDOUT(KIND=DISK, TITLE=”DIR.TXT”, IOHSTRING=”EXMODE=ALL”)