Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Submitting REXEC and RSH requests in batch z/OS Communications Server: IP User's Guide and Commands SC27-3662-00 |
|
You usually run REXEC and RSH interactively by entering the command and then receiving the results at your terminal. However, you can also run REXEC and RSH as a batch job. To accomplish this, you must supply the necessary job control language (JCL) and submit it to the job entry subsystem (JES) using the TSO SUBMIT command. The command format when submitted as a batch job is the same as the command format described in REXEC command—Execute a command on the remote host and receive the results on your local host. You enter the command as a parameter on the EXEC statement. The results of the command executed on the remote host are stored on the local host according to how you define the SYSPRINT DD statement. The data set characteristics should be consistent with the output from the command you are executing at the remote host. When you invoke the REXEC command, a check is made to see if a data set is allocated to INPUT. If a data set is allocated, any input is read from that data set rather than from your terminal. Similarly, a check is made to see if data set is allocated to OUTPUT. If so, all REXEC output is written to that data set rather than to your terminal. The REXECD or RSH server does not support output being returned to output DD statements other than SYSTSPRT, SYSPRINT or OUTPUT. Sometimes it is necessary to direct the output from a REXEC or RSH batch request to an OUTPUT DD and to include a SYSPRINT DD with SYSOUT=* specified. This is particularly true if the REXEC or RSH command to be executed contains a slash(/). There might be times when REXEC and RSH are being executed and the user does not want the output to be directed to the SYSPRINT DD file. If a //OUTPUT DD card is coded, output will be directed to it. This DD statement must be directed to a SYSOUT or a validly defined data set. If multiple REXEC or RSH commands are being executed in one step, then it is recommended that DISP=MOD be coded on the //OUTPUT DD card. This will allow each command execution to be appended to the previous output. If the //OUTPUT DD card specifies a nullfile (ie. DSN=NULLFILE or DD DUMMY), then the //OUTPUT DD statement will not be used. Regardless of which ddname you use for the REXEC or RSH output, a new data set must have the DCB=(...) parameter specified on the DD card. Any data set you use must have a logical record length (LRECL) greater than 0. If the LRECL is equal to 0 then the data set is not used. When using the REXECD server, the procedure specified
in the TSOPROC argument of the startup procedure must have the //SYSTSPRT
DD statement appearing before any other output DD specifications in
the procedure. For example, if the batch procedure specified was TSOPROC=TESTJOB, the following example would be the correct
specification for the batch procedure for REXECD:
Adding a PARM argument to the EXEC JCL DD statement for commands to be submitted to batch might cause unpredictable output, characters to be lost, or output to be presented out of order. If DDs are dynamically allocated, the order of output
returned might be unpredictable. For example, the following TSO/E
CLIST were invoked as the remote execution command, using the procedure
TESTJOB:
In this case, the output might be returned as:
In the following example, the TESTJOB procedure was modified
to add the OUT DD statement:
The CLIST was also modified,
as in the following example (notice that the ALLOC FI(OUT) and the FREE FI(OUT) have been removed):
The output appears as in the following example:
Be aware that output being returned to the client from
DDs other than SYSTSPRT or SYSPRINT might have characters truncated.
This behavior has been observed only in the first line of new output
files other than SYSTSPRT or SYSPRINT. If you use DDs other than
SYSTSPRT or SYSPRINT, you might want to ensure that the first line
of the output file contains a blank line, so that no data is lost.
Notes:
The following example shows REXEC JCL Spooling Output to JES:
Note: The data set containing the
JCL cannot have sequence numbers.
The following example shows the use of the userid.NETRC.DATA containing the user ID and password.
The output is sent to a permanent data set for later use.
Note: When running
REXEC in batch, the user ID assigned to the job is used as the user_id in the NETRC data set.
The following example shows the use of the NETRC DD statement
in batch. The NETRC DD statement can be used in batch to override
the default userid.NETRC.DATA or userid.NETRC files.
Note: The
user ID and password are retrieved from TST.REXEC.NETRC instead of
userid.NETRC.DATA or userid.NETRC.
|
Copyright IBM Corporation 1990, 2013
This information center is Built on Eclipse™ ( www.eclipse.org ).
|