Purpose
Use the REXEC command to execute
a command on the remote host and receive the results on the local
host.
Format
>>-REXEC--+-----+--+---------+--+-----+--+-----+--+-----+------->
'- -?-' '- -b tab-' '- -d-' '- -m-' '- -n-'
.- -s 512--.
>--+-------------+--+--------------+--+----------+-------------->
'- -l user_id-' '- -p password-' '- -s port-'
>--+--------------------+--foreign_host--command---------------><
'- -t --dataset_name-'
Restriction: The REXEC parameters -b, -d,
-l, -m, -n, -p, -s, and -t are case sensitive and must be entered
in lowercase letters. The user_id and password parameters might be case sensitive, depending
on the operating system of the remote host.
Parameters
- -?
- Displays the help message.
- -b tab
- Specifies the Tab setting. Valid values are in the range 1 - 12
and the default value is 1.
- -d
- Activates debug tracing.
- -m
- Specifies that the machine control character (X'09')
is added to the beginning of the output lines for the data sets that
are associated with the SYSPRINT or OUTPUT DD cards and have the machine
control attribute. When you use this parameter, it should be the
first parameter that is passed to REXEC so that all output lines are
changed.
- -n
- Prevents automatic logon, if the same foreign host name is defined
in the NETRC data set.
- -l user_id
- Specifies the user ID on the foreign host.
- -p password
- Specifies the password for the user ID on the foreign host.
- -s port
- Specifies the TCP port number of the REXEC server on the foreign
host. The default, 512, is the port number defined in /etc/services.
- -t tran_table
- Specifies the data set name of a translation table to be used.
The search order when the -t parameter is specified:
userid.tran_table.TCPXLBIN
hlq.tran_table.TCPXLBIN
If this data set is not found,
REXEC terminates with message EZA4805I. Note: If the -t parameter
is not specified on the invocation of the REXEC command, a hardcoded
default table is used that is identical to the STANDARD member in
the SEZATCPX data set.
- foreign_host
- Specifies the name or IP address of the foreign host to which
you are sending the REXEC command. Specify the foreign host by its
host name or IP address. When you are using IPv6 link-local addresses,
you can provide scope information along with the host name or IP address,
as described in the support for scope information in the z/OS Communications Server: IPv6 Network and
Application Design Guide.
- command
- Specifies the command to be executed on the remote host.
Example
Use the REXEC command without using
NETRC.DATA:
READY rexec -l user28 -p user28 -s 512 mvs1 lista
MVS TCP/IP REXEC CS V1R2
SYS1.HELP
GIM.SGIMCLS0
DSN230.DSNCLIST
USER.CLIST
BUILD.CLIST
SYS1.HRFCLST
USER28.RSHD5.JOB00160.D0000103.?