It can be done, at least I'm doing it on my single LPAR machine.
HOW!!????!??
1. Create a script to use unix services date command to build set cards
for date and time. Put the set cards into a PDS that will be
concatenated in a JES2 PROC DD.
Contents of /usr/local/bin/datetime -
#!/bin/sh
#
# script to update the current date and time
#
echo "// SET DATE="`date '+%m%d%y'` > /tmp/datetime
echo "// SET TIME="`date '+%H%M'` >> /tmp/datetime
cp /tmp/datetime "//'SYS1.SETVAL.PROCLIB(DATETIME)'"
rm /tmp/datetime
2. Create a file for loading the crontab to run the datetime script
once per minute.
Contents of /cronfile -
0-59 * * * * /usr/local/bin/datetime
3. Load /cronfile into crontab -
crontab /cronfile
This tells cron to run the script will run once per minute, at the top
of the minute.
4. Concatenate the PDS containing the DATETIME member in the JES2 PROC
DD.
//JES2 PROC MEMBER=00
//IEFPROC EXEC PGM=HASJES20,
// DPRTY=(15,15),TIME=1440,PERFORM=9
//PROC00 DD DISP=SHR,DSN=SYS1.PROCLIB **** BATCH PROCS ***
// DD DISP=SHR,DSN=SYS1.SETVAL.PROCLIB
5. Start the cron daemon (there are different ways to do this, we use
JCL to which gives a consistent jobname in the d a,l displays)' Also
remember to configure the cron daemon to start at IPL.
The userid that is used to run the cron daemon should have a uid=0.
//$PDACRON JOB ($PROD),'$PDACRON',MSGCLASS=X,CLASS=I,
// MSGLEVEL=(1,1)
//* * * * * * * * * * * * * * * * * * * * * * * * * *
//IEFPROC EXEC PGM=IKJEFT01,DYNAMNBR=50
//SYSEXEC DD DSN=SYS1.SBPXEXEC,DISP=SHR
//SYSTSPRT DD TERM=TS,SYSOUT=X
//SYSTSIN DD *
oshell /usr/sbin/cron
6. Add the "// INCLUDE MEMBER=DATETIME" card after the JOB card.
Code the date and time variables in your DSN name.
//$USER19A JOB (BATCH),IEFBR14,MSGCLASS=X,CLASS=I,
// MSGLEVEL=(1,1),NOTIFY=&SYSUID
// INCLUDE MEMBER=DATETIME
//STEP01 EXEC PGM=IEFBR14
//SYSPRINT DD SYSOUT=*
//VDSBYPAS DD DUMMY
//DD1 DD DSN=$USER19.D&DATE..T&TIME,
// UNIT=SYSALLDA,DISP=(,CATLG),
// SPACE=(CYL,(1)),
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=27920)
Thus, the variables resolve to the current date and time -
000001 //$USER19A JOB (BATCH),IEFBR14,MSGCLASS=X,CLASS=I,
000002 // MSGLEVEL=(1,1),NOTIFY=&SYSUID
=NOTE= -- MSGLEVEL=(1,1),NOTIFY=$USER19
000003 // INCLUDE MEMBER=DATETIME
=NOTE= I1// SET DATE=051707
=NOTE= I1// SET TIME=1348
000004 //STEP01 EXEC PGM=IEFBR14
000005 //SYSPRINT DD SYSOUT=*
000006 //VDSBYPAS DD DUMMY
000007 //DD1 DD DSN=$USER19.D&DATE..T&TIME,
=NOTE= --DD1 DD DSN=$USER19.D051707.T1348,
000008 // UNIT=SYSALLDA,DISP=(,CATLG),
000009 // SPACE=(CYL,(1)),
000010 // DCB=(LRECL=80,RECFM=FB,BLKSIZE=27920)
Possible gotcha's
1. Running jobs that create the same date/time stamp in less than one
minute can result in 'not cat 2' files. (or within the same day with a
date stamp only.)
2. The pds where the DATETIME member is stored must be compressed
regularly. In our case, once a day is plenty on a 7 cylinder file.
Thanks,
Jim Weidt
Senior Systems Engineer
Jostens Inc.
Office: 952-838-7555
Cell: 612-419-3738
[EMAIL PROTECTED]
CONFIDENTIALITY NOTICE: The information contained in this e-mail
communication and any attached documentation may be privileged,
confidential or otherwise protected from disclosure and is intended only
for the use of the designated recipient(s). It is not intended for
transmission to, or receipt by, any unauthorized person. The use,
distribution, transmittal or retransmittal by an unintended recipient of
this communication is strictly prohibited. If you are not the intended
recipient of this e-mail, please delete it from your system without
copying it and notify the above sender.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html