Re: date processing in z/OS



On 10/1/2008 at 1:22 PM, in message
<46QEk.210298$DI2.106177@xxxxxxxxxxxxxxxxxxxxxx>, William M.
Klein<wmklein@xxxxxxxxxxxxxxxxx> wrote:
Frank,
Have you looked at using "environment variables"? These can be set
via LE
run-time option and then queried within a COBOL program. If you have any


questions on how to do this, let me know (on or off-list).

I think this might be the answer! I knew about CEEENV, but I yesterday I
was not able to find out how to set them in the JCL. But now that you have
triggered my thought process I was able to find it.

So how's this for some JCL:

//CEEENV2 JOB '',FRANK,CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//JOBLIB DD DISP=SHR,DSN=FJS.PDS.LOAD
//STEP1 EXEC PGM=CEEENV1,PARM='/RPTOPTS(ON)'
//CEEOPTS DD *
ENVAR(BUSDATE=20081230)
//SYSIN DD *
BUSDATE
//

The program CEEENV1 calls the CEEENV routine and retrieves the environment
variable called BUSDATE. Works like a charm!

I think I have to set the ENVAR using the DD:CEEOPTS method, rather than the
PARM method, because we have some IMS job and if it's anything like VSE's
DL/I we can't use the PARM clause on the EXEC card to specify LE runtime
options, because the program that actually executes is the IMS (or DLI)
execute driver, and it is not (under VSE) LE-enabled. Haven't actually
tried it under z/OS, so perhaps it will work, but I think the CEEOPTS is the
better way to go, since I can just have something like:

Member FJS.PDS.JCL(BUSDATE)
//CEEOPTS DD DISP=SHR,DSN=FJS.PDS.COBOL(BUSDATE)

Member FJS.PDS.COBOL(BUSDATE):
ENVAR(BUSDATE=20081230)

Member FJS.PDS.JCL(CEEENV2):
//CEEENV2 JOB '',FRANK,CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//JOBLIB DD DISP=SHR,DSN=FJS.PDS.LOAD
// JCLLIB ORDER=FJS.PDS.JCL
//STEP1 EXEC PGM=CEEENV1,PARM='/RPTOPTS(ON)'
//SYSIN DD *
BUSDATE
// INCLUDE MEMBER=BUSDATE
//

I don't see any flaws, so I think I will go this way. Thanks Bill!!!

Frank

.