Remote Command Transfers

To execute a command on a remote system, you must specify both the type of a command and the actual command to be executed.

If the remote system is a Window or UNIX system, the parameter is /RC or /RemoteCommand. For z/OS, - /E, /EXEC, /RE, and /REXXEXEC are all acceptable for an executable. /SJ and /SUBJCL are used to submit job control language. /CJ and /CALLJCL are used to call programs with JCL linkage. /CPG and /CALLPGM are used to call a program with standard linkage. Each of these parameters must be followed by the command to be executed.

To have a command executed remotely, specify the positional /COMMAND parameter followed by the option and command to be executed.
FTMSCMD /SEND /[other parameters] /COMMAND /RemoteCommand: 
command_to_execute local_file_name

Remote commands can only be executed as a Send. The local file name is used to store the output of the remote command if the remote system is Windows or UNIX. z/OS does not send back any output.

The following example illustrates an execution of the dir command on a remote machine and whose output is stored on the local machine in the local_file_name file.
FTMSCMD /SEND [parameters] /COMMAND /RemoteCommand:dir local_file_name
In the following example, TESTJCL ABC123 is sent to a remote z/OS machine for execution. With remote command execution to a z/OS machine, no output is returned. Therefore, a local file name is unnecessary.
FTMSCMD /SEND [parameters] /COMMAND /CALLJCL="TESTJCL ABC123”