Set Dependent Job using JS (SETDEPJS)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The Set Dependent Job using Job Scheduler (SETDEPJS) command allows you change the completion flag from *YES to *NO or vice versa for a predecessor job in a predecessor/successor relationship. The completion flag indicates whether a job has processed. This command allows you to indicate that a job has or has not completed so that a dependent job can be submitted or omitted from submission.

For instance, you could set up an end of day (EOD) job that runs every week day at 5:00 p.m.. A dependent job for end of week (EOW) processing could also set up that is scheduled to run on Friday after the EOD job is completed. A third job called EOWCHECK (end of week check) could be set up whose only purpose is to change the completion flag on the EOD job from *YES to *NO. This EOWCHECK job would run prior to 5:00 p.m. on Friday. The reason you would want to do this is to allow the EOW job to run on Friday after the EOD job is completed. The following command string could be used to accomplish this:

SETDEPJS   PREDJOB(EOD)  SUCCJOB(EOW)  COMPLETE(*NO)

Top

Parameters

Keyword Description Choices Notes
PREDJOB Predecessor job entry Element list Required, Positional 1
Element 1: Job Name
Element 2: Group Name, *NONE
Element 3: Group sequence 1-99, *NONE
SUCCJOB Successor job entry Single values: *ALL
Other values: Element list
Optional, Positional 2
Element 1: Job Name
Element 2: Group Name, *NONE
Element 3: Group sequence 1-99, *NONE
COMPLETE Complete *YES, *NO Optional
Top

Predecessor job entry (PREDJOB)

Specifies the name of the predecessor job schedule entry that you want to change. You must specify a job for every job and optionally can specify a group to which the job belongs as well as a sequence number for the job within the group.

The first job of a group must be sequence number 1. Subsequent sequence numbers should leave gaps (10, 20, 30 and so on) to allow job insertions if necessary.

This is a required parameter.

Element 1: Job

name
Specify the user-defined name of the predecessor job schedule entry that you want to change.

Element 2: Group

*NONE
The job is not assigned to a group.
name
Specify the user-defined name of the group to which the job belongs.

Element 3: Group sequence

*NONE
There is not a sequence number assigned to the job.
1-99
Specify the sequence number of the job within the group. Sequence numbers can range from 1 to 99.
Top

Successor job entry (SUCCJOB)

Specifies the name of the successor job schedule entry that you want to change. You must specify a job for every job and alternately can specify a group to which the job belongs as well as a sequence number for the job within the group.

The first job of a group must be sequence number 1. Subsequent sequence numbers should leave gaps (10, 20, 30 and so on) to allow job insertions if necessary.

Single values

*ALL
All successor jobs are included in the jobs that you are changing.

Element 1: Job

name
Specify the user-defined name of the successor job schedule entry that you want to change.

Element 2: Group

*NONE
The job does not belong to a group.
name
Specify the user-defined name of the group to which the job belongs.

Element 3: Group sequence

*NONE
The job does not have a sequence number
1-99
Specify the sequence number of the job within the group.
Top

Complete (COMPLETE)

Specifies whether you want to change the completion flag for a predecessor job from completed (*YES) or not completed (*NO) or vice versa.

*YES
Change the completion flag to *YES.
*NO
Change the completion flag to *NO.
Top

Examples

Example 1: Changing a Predecessor Job

SETDEPJS   PREDJOB(JOB10)  SUCCJOB(JOB11)

This command sets job JOB10 to processed, thus freeing JOB11 to run as a successor job to JOB10.

Example 2: Triggering End-of-Week Processing

SETDEPJS   PREDJOB(EOD)  SUCCJOB(EOW)  COMPLETE(*NO)

This command sets up an end-of-day (EOD) job that runs every week day at 5:00 p.m. A dependent (successor) job for end-of-week (EOW) processing could also be set up that is scheduled to run on Friday after the EOD job is completed. A third job called EOWCHECK (end of week check) could be set up whose only purpose is to change the completion flag on the EOD job from *YES to *NO. This EOWCHECK job would run prior to 5:00 p.m. on Friday. The reason you would want to do this is to allow the EOW job to run on Friday after the EOD job is completed. This command would be used in the EOWCHECK job.

Top

Error messages

Unknown
Top