Suppose that before a job submission you had to update the JCL with the current date, or the jobid of a previously run job. As mentioned in the introduction, such updates are inconvenient at best, and can be a source of errors, as well.
You can use AutoEdit terms to eliminate the need for such updates. In your exercise, you will use several AutoEdit variables in trivial comment lines, but these comment lines will nonetheless demonstrate the usefulness of AutoEdit terms.
//* Today’s working date is: %%ODATE
//* Today’s system date is: %%DATE
//* Today’s working day is: %%ODAY
//* The current job order id is: %%ORDERID
The Sysout contains the comment lines you inserted in the JCL, as shown in Figure 43). Notice that the AutoEdit variables in the JCL resolved to their appropriate values.
Figure 43 Sysout for Job IDJOB6
------------- CONTROL-M/CONTROL-R SYSOUT VIEWING ------ PAGE 2 OF 3
COMMAND ===> SCROLL===> CRSR
MEMNAME IDJOB6 OWNER ID JOBNAME M21 ODATE 020201
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
1 //M21 JOB APERLMAN,CLASS=A,
// MSGCLASS=X,NOTIFY=M21,
// MSGLEVEL=(1,1)
//*---- SUBMITTED BY CONTROL-M (FROM MEMLIB) ODATE=010131
//*---- SCHEDULE CTM.TEST.SCHEDULE(IDGS3)
//*---- JCL CTM.TEST.JCL(IDJOB6)
//*---- CONTROL-M JOB IDENTIFICATION: ORDER ID=001S2 RUN NO.=00001
//* TODAY'S WORKING DATE IS: 010202
//* TODAY'S SYSTEM DATE IS: 010202
//* TODAY'S WORKING DAY IS: 02
//* THE CURRENT JOB ORDER ID IS: 001S2
2 //S1 EXEC PGM=IEFBR14
**** END OF DATA SET - ADDED BY CONTROL M **** DO NOT USE IT IN YOUR PROGRAM !!
ICH70001I STCUSER LAST ACCESS AT 02:00:13 ON FRIDAY, FEBRUARY 02, 2001
ICH70001I STCUSER LAST ACCESS AT 02:00:13 ON FRIDAY, FEBRUARY 02, 2001
IEF142I M21 S1 - STEP WAS EXECUTED - COND CODE 0000
--------------------------------- - BMC - -----------------------------------
- CPU (Total) Elapsed CPU (TCB)
-Program Stepname ProcStep RC I/O hh:mm:ss.th hh:mm:ss.th hh:mm:ss.th
COMMANDS: LEFT, RIGHT, FIND str, FIND str PREV, N n, P n, END 03.20.12
It you were to run this job again tomorrow, then the variables would resolve accordingly. It should be apparent, that use of AutoEdit system variables such as %%ODATE can eliminate the need to manually update the JCL before a job is run.
Before continuing with the exercise, take a closer look at certain date concepts and AutoEdit date variables.
Parent Topic |