Tuesday, March 31, 2009

DETERMINING WHETHER A JOB IS RUNNING INTERACTIVE OR BATCH IN CL

Use RTVJOBA command to find it out . Below is the small Program i made in order to find it out .
If anybody have some other technique also then he can kindly mail me .
PGM
DCL VAR(&JOBTYPE) TYPE(*CHAR) LEN(1)
RTVJOBA TYPE(&JOBTYPE)
IF COND(&JOBTYPE *EQ '0') THEN(GOTO START)
/* Interactive Program Section */
SBMJOB CMD(CALL PGM(ITSELFCL)) JOB(SBMITSELF)
SNDPGMMSG MSG('Tell user program Itself Submitted')
RETURN
START:
/* Mainline Batch Program */
If the Job Type is 0, it's running in batch, and if it's 1, it's interactive.

No comments:

Post a Comment