Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The COZZI - Check Active Job (CHKACTJOB) command quickly searches the system for an active job that matches the job name and optional Job Type and Status parameters. If an active job for the Job Name specified is detected, nothing happens. If it does NOT find a matching job, CPF1070 is sent as an *ESCAPE message. This message may be monitored using the MONMSG command.
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
JOB | Job | Qualified job name | Required, Positional 1 |
Qualifier 1: Job | Name | ||
Qualifier 2: User | Name, *ALL | ||
Qualifier 3: Number | 000000-999999, *ALL | ||
STS | Job status to check | *ACTIVE, *JOBQ, *OUTQ, *ALL, *ANY | Optional, Positional 2 |
TYPE | Job Type to check | *INTERACT, *INTER, *BATCH, *BCH, *AUTOSTART, *AUTO, *MONITOR, *SPLRD, *SPLWR, *SPLWRT, *SYSJOB, *SYS, *SCPF, *ALL, *ANY | Optional, Positional 3 |
Top |
Specifies the job name that is used to search for a job whose status and type match the STS and TYPE parameters. This is normally a simple name, such as JOB(USER) rather than a fully qualified name.
This is a required parameter.
Qualifier 1: Job
Qualifier 2: User
Qualifier 3: Number
Top |
Specifies job status of the job name being checked.
Top |
Specifies type of job (interactive, Batch, prestart, etc.) to be checked for active status.
Top |
Example 1: Simple Command Example
CHKACTJOB JOB(QHTTP) MONMSG MSGID(CPF1070) EXEC(DO) SNDPGMMSG MSG('No HTTP Job found.') ENDDO
This command checks if the job named QHTTP is active. If it is, the CL program continues. If it is not found, message ID CPF1070 is issued as an *ESCAPE message and the "No HTTP Job found." message is sent to the caller.
Example 2: More Complex Command Example
CHKACTJOB JOB(PAYROLL) TYPE(*BATCH) MONMSG MSGID(CPF1070) EXEC(DO) GOTO CONTINUE ENDDO SNDPGMSG MSG('Payroll is running. Try again later.') RETURN /* Return to caller. Do not continue. */ CONTINUE: SNDPGMMSG MSG('Payroll not active; continuing...') ENDPGM
This example checks if the PAYROLL job is running. If it is, the CL program ends. Otherwise it continues.
Top |
Top |