Page 1 of 1

To find current date

PostPosted: Sat Jul 05, 2008 9:58 am
by divya1978
How to find the current date in jcl ?

Suppose in DD step pds is defined with as &ddmmmyyyy parameter then how will we access the current file ?

Re: To find current date

PostPosted: Sat Jul 05, 2008 10:23 am
by dick scherrer
Hello,

Plase post the entire dd statement.

JCL does not know the current date, but there is probably a way to accomplish what you want.

Suppose in DD step pds is defined with as &ddmmmyyyy parameter then how will we access the current file ?
Along with posting the dd statement, please clarify this.

Re: To find current date

PostPosted: Sat Jul 05, 2008 10:49 am
by divya1978
If DD statement is
//DD DSN = DW.PROGRAM1.INFILE.&DDMMYYYY,DISP= SHR

So the file jcl should pick is the current file as file is created on daily basis with date extension by batch?

Re: To find current date

PostPosted: Sat Jul 05, 2008 10:59 am
by dick scherrer
Hello,

That is what i was afraid of. . . An 8-digit number is invalid as a node of a dataset. You can verify this by removing the symbolic and putting in today's date to run a test. The job will raise a jcl error.

A better approach might be to make the file a gdg and create a +1 generation each day. When processing, the DW.PROGRAM1.INFILE(0) would be used with no need for the ddmmyyyy digits.