To find current date



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

To find current date

Postby divya1978 » Sat Jul 05, 2008 9:58 am

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 ?
divya1978
 
Posts: 5
Joined: Thu Jul 03, 2008 10:45 am
Has thanked: 0 time
Been thanked: 0 time

Re: To find current date

 

Re: To find current date

Postby dick scherrer » Sat Jul 05, 2008 10:23 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: To find current date

Postby divya1978 » Sat Jul 05, 2008 10:49 am

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?
divya1978
 
Posts: 5
Joined: Thu Jul 03, 2008 10:45 am
Has thanked: 0 time
Been thanked: 0 time

Re: To find current date

Postby dick scherrer » Sat Jul 05, 2008 10:59 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post