1

I used the following job to issue another job at a specific time, but it didnt give the desired result.

//STRTJOB   JOB CLASS=A,NOTIFY=&SYSUID
//STEP1    EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=T
//SYSIN    DD=DUMMY
//SYSUT1   DD SYSOUT=(*,INTRDR)
//SYSUT1   DD DATA,DLM=XX
/*$TA10,T=00.00,I=86400,´$VS,´´s  JOB,N=MYJOB´´´
//XX

STRTJOB was supposed to start MYJOB at 00.00 every night. I executed STARTJOB at 9:00 am and I expected MYJOB to be issued at 00.00 every night, but what I got was disappointing, MYJOB was implemented just at 09.00 am and it repeated every day at 09.00. What can I do for MYJOB to be executed just at 00.00?

Soraya
  • 29
  • 3

1 Answers1

4

Setting aside some JCL errors in the posted JCL sample. To accomplish what you want you would code your JES2 automatic command as follows:

$TA10,T=24.00,I=86400,'$VS,''s  JOB,N=MYJOB´´´

The above means 24 hours and 00 minutes from the LAST midnight and an interval of 24 hours (86400 seconds).

So now backing up to the command coded in the sample, the reason the command would execute immediately when T=00.00 is specified is that this is getting resolved by JES2 the same way as though T= was not specified at all. Since only the interval seems to remain valid in this case, the command is issued immediately and then issued again in 24 from the time which the automatic command was created (which in sample specified was 9am).

You can use the $TA,ALL command to verify when the next command will be issued.

The Jes2 docs do specify the following:

If you specify a time that is earlier than the current time, and you specify an interval, the command is issued immediately, and then repeated at the specified time with the given interval. If you specify a time that is earlier than the current time, without specifying an interval, the command is issued immediately and then cancelled.

ZEOD
  • 146
  • 2