Selecting a Command Processor
Youcan use the REXEC server command processing selection exit program
(QIBM_QTMX_SVR_SELECT) to select which command processor the REXEC
server uses to run the submitted command. (If you do not use an exit program, the
REXEC server uses the AS/400 Control Language (QCAPCMD) processor.)The
allowed command processors are:
vAS/400 Control Language (QCAPCMD)
vQshell interpreter
vSpawned path (a shell script or program object)
Because data conversion is optional for the Qshell and spawn options, the exit
program also selects whether the REXEC server performs ASCII-EBCDIC
conversions on the stdin, stdout, and stderr streams.
REXEC Connection Usage
The REXEC protocol allows a REXEC client to specify whether to use one or two
connections for returning data.
For AS/400 CL command processing
If you choose AS/400 CLcommand processing and two connections, normal output
returns on the first connection, and error output returns on the second connection.
The REXEC server returns all spooled data that is written to the default printer file
(*PRTF). This includes data that is written to the screen if the command is run in an
interactive job. Any messages written to the job log return to the client on the
second connection.
If the client specifies that all data is returned on a single connection, the job log
messages are returned first, followed by any spooled output.
For Qshell and spawned path command processing
For Qshell or spawned path command processing, the REXEC server by default
returns normal output on the first connection and error output on the second
connection. (The REXEC stdin, stdout, and stderr streams are mapped to file
descriptors 0, 1, and 2 respectively, and the QIBM_USE_DESCRIPTOR_STDIO
environment variable is set to Y.)These options allow you to redirect input and
output.
Choosing the Qshell command processor sets these environment variables:
vTERMINAL_TYPE=REMOTE
vPATH=/usr/bin
vLOGNAME=
user
, where
user
is the user profile
vHOME=
homedir
, where
homedir
is the user’s home directory
The child job inherits any other environment variables that the exit program sets.
Spawned child processes are batch jobs or prestart jobs. They cannot do interactive
I/O. See

ILE C for AS/400 Programmer’s Guide

, SC09-2712-01 for complete details
on this support.
Chapter16. REXEC Server 401
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|