In an AS/400 APPC or APPN network, it is often necessary or desirable to run a job on another system in the network. There are a couple of ways to do this. First you can sign on the remote system with a STRPASTHR command and run the job, either interactively or batch. But you can also take advantage of a SBMRMTCMD command on your system to drive the job on the other system. This is much more efficient than passing through.
To use the SBMRMTCMD command, you first have to create a DDM file in a library. This is done as follows:
CRTDDMF FILE(xxx/REMOTESYS) + RMTFILE(xxx/RMTJOB) + RMTLOCNAME(STLOUIS) + TEXT('DDM file for SBMRMTCMD')
The DDM file (local) is used as a pathway to the remote system and the file declared as RMTFILE (remote) does not really have to exist. Neither the local system nor the remote system is actually looking for this file.
Now the SBMRMTCMD command takes on the form as shown below:
SBMRMTCMD CMD('CALL RMTLIB/JOB01') + DDMFILE(xxx/REMOTESYS)
This will call program JOB01 on the remote system. Notice the reference to a DDM file is the same one created in the first step. The job to be run is JOB01 and is a user-written program which must exist in library RMTLIB. Any job can be run at the remote system, including IBM-supplied commands, CL programs, etc. The SBMRMTCMD command could be placed on a menu or created as a command, thus freeing the user from passing through to the other system. If the remote job creates printer output, it will of course print on the remote system; however, the remote job can direct it to an output queue and then use SNDNETSPLF command to send it back to the requester.