Submitting remote jobs
OptiConnect allows jobs to be submitted on the local system and started as a batch job on the target system transparently.
You must create these jobs using the Submit Job (SBMJOB) or Submit Database Jobs (SBMDBJOB) command. The transparency is achieved by replacing the QCMD routing entry in a subsystem description (SBSD) with an entry that will route the submitted job to the remote system.
Here is an example of configuring remote job submission:
- Create a routing entry that calls QYYCROUT with two input parameters.
Routing entries do not allow program parameters. You need to create a program to call QYYCROUT and pass the parameters. The program should look like the following CL program example ROUTEPGM:
PGM CALL PGM(QSOC/QYYCROUT) PARM(ddmfile libname) ENDPGM- Add a routing entry to a subsystem description (SBSD) and specify ROUTEPGM as the program to call.
- Create or change a job description to specify the routing data that is to be the compare value for the routing entry just added.
All jobs submitted with this job description will be run on the remote system by the QYYCROUT program.
- When the job is submitted, QYYCROUT is started. QYYCROUT then extracts information from the DDM file passed in. This DDM file is not used after this. Here are the parameters for the DDM file:
- Device = QYCTSOC
- Mode = BATCHJOB
- LCLLOCNAME = *LOC
- REMOTE SYSTEM = target system name
- QYYCROUT creates a data queue and a DDM file in the QTEMP library. It starts a SOCAnnnnnn job and creates a data queue on the target system.
- QYYCROUT retrieves job attributes, cancel severity, and local data area (LDA). The job and LDA information is sent to the remote data queue on the target system. The target system runs a program to receive this information and changes the attributes of the target job to match the source job.
- QYYCROUT extracts information about inline data files and copies them to QTEMP in the target job.
The job queue on the source system receives request data one command at a time and runs each request on the target system. After each command is run, the target job returns an indication of whether cancel severity has been exceeded. This allows QYYCROUT to decide if the job should be terminated. Because commands are run one at a time, holding the job on the source system ends command execution on the target system until the job is released.
After all the requests have been received and run, and if message logging is set to something other than *NOLIST, the target job log is retrieved and written to QPJOBLOG. The user data field is set to the target system name.
To route the spooled file back to the source system, follow these steps:
- Create a remote output queue by using the Create Output Queue (CRTOUTQ) command.
- Specify the system name that you will be routing files to in the remote system (RMTSYS) parameter. This allows you to supply information to the remaining parameters.
- For the remote printer queue (RMTPRTQ) parameter, specify the output queue to which the remote writer sends the spooled file.
- Run the Start Remote Writer (STRRMTWTR) command on the target system. See Figure 1 and Figure 2.
Figure 1. Remote job submission source systemFigure 2. Remote job submission target system