英文:
Automatic JCL job
问题
我使用以下作业在特定时间发布另一个作业,但没有得到期望的结果。
//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应该在每天晚上00:00启动MYJOB。我在上午9:00执行了STARTJOB,并期望MYJOB每天晚上00:00发出,但我得到的是令人失望的结果,MYJOB仅在上午09:00执行,并且每天都在上午09:00重复。我应该怎么做才能让MYJOB在每天00:00执行?
英文:
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?
答案1
得分: 4
除了发布的JCL示例中的一些JCL错误之外。要实现您想要的功能,您需要将您的JES2自动命令编码如下:
$TA10,T=24.00,I=86400,'$VS,'s JOB,N=MYJOB'''''
上述意味着从上一个午夜开始的24小时和00分钟,以及24小时的间隔(86400秒)。
现在回到示例中编码的命令,当指定T=00.00
时,命令会立即执行的原因是,这与未指定T=
时JES2解析方式相同。在这种情况下,只有间隔似乎仍然有效,因此命令会立即发出,然后在自动命令创建的时间之后的24小时内再次发出(在示例中指定的时间是上午9点)。
您可以使用$TA,ALL
命令来验证下一条命令将何时发出。
Jes2文档确实指定了以下内容:
如果您指定的时间早于当前时间,并且指定了一个间隔,那么命令会立即发出,然后在指定的时间以给定的间隔重复。如果您指定的时间早于当前时间,而没有指定间隔,则命令会立即发出,然后取消。
英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论