900-LOAD-JOB

900-LOAD-JOB provides a practical method for easily modifying an existing job without redefining the whole job over again. By using the 900-LOAD-JOB routine, the calling program does not need to know what the current job definition is all the way down to the current parameter settings.

900-LOAD-JOB populates the JOBREQ group from the an existing job definition. The JOBSTP-PRINTER , JOBSTP-DIST-GRP , JOBSTP-NBR-COPIES , and JOBSTP-SAVE fields are retrieved from the JOBSTPRPT record for the default print file. In other words, the routine retrieves the field values assigned to the FormID .prt print file.

To use the 900-LOAD-JOB routine

  1. Perform 900-LOAD-JOB , which populates the JOBREQ group from the an existing job definition.

  2. Modify the JOBREQ group fields as needed.

  3. Perform 900-CREATE-JOB or 900-CREATE-AND-SUBMIT-JOB .

Library JOBRTNS
Optional Fields (None)
Output Updates or adds job entries in the JOBSTP job definition file.

Required Fields

Field Type and length Definition
JOBREQ-USER-NAME A 10 Case-sensitive user name used to define the job.
JOBREQ-JOB-NAME A 10 Actual job name used to define the job.

Unused Fields

The following fields are not populated by 900-LOAD-JOB . The field values remain unchanged after the call to 900-LOAD-JOB . This means that any field values or default values in these fields prior to the call to 900-LOAD-JOB will be the same after the call.

Field Type and length Definition
JOBREQ-CREATE A 1 Y = Deletes an existing job definition before creating a new one.
JOBREQ-MODIFY A 1

Y = Deletes an existing job definition before creating a new one.

Note: If neither JOBREQ-CREATE nor JOBREQ-MODIFY has a value of Y, the routine sets JOBREQ-MODIFY to Y.
JOBREQ-DELQJB A 1 Deletes all Job Scheduler entries for the job except for running jobs. If the job already exists and it is running, then the routine fails and returns Y in the WSJR-ERROR field.
JOBREQ-NO-MOD-IF-EXISTS A 1 Forces the routine not to update the job if it already exists. If the job exists, then the routine returns Y in the WSJR-ERROR field.
JOBREQ-JOB-QUEUE A 5 Job queue you want to submit the job through. (If left blank, the default queue is used.)
JOBREQ-START-TIME N 8 Date the job should start. (If left blank, the job starts now.)
JOBREQ-START-DATE N 6 Time the job should start. (If left blank, the job starts now.)

Return Value

Field Type and length Definition
WSJR-ERROR A 1

Y = Call failed.

N = Call successful.

M = Maximum number of steps (20) have been read into JOBREQ . The job definition contains more steps but the JOBREQ group cannot load them all.