Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Pass Date in the DSN as MMMDD ina JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
chockalingam_rsp

New User


Joined: 13 Aug 2009
Posts: 43
Location: chennai

PostPosted: Wed Dec 03, 2014 12:57 am    Post subject: Pass Date in the DSN as MMMDD ina JCL
Reply with quote

Hi ,

i want to pass the current date in the format MMMDD as a LLQ in a JCL . How can i do that ?

This input file is being passed from another system . My jcl uses this file and does a SORT on this file.

//JS025R EXEC PGM=SORT
//SYSOUT DD SYSOUT=X
//SYSPRINT DD SYSOUT=X
//SYSUDUMP DD SYSOUT=X
//SORTIN DD DSN=INPUT.SEQFILE.<<DEC02>>,
// DISP=SHR,DCB=BUFNO=35
//SORTOUT DD DSN=OUTPUT.FILE,
// DISP=(,CATLG,DELETE),
//SYSIN DD *

everytime i run this jcl , i am going and changing it manually . .

Can you help on how this can be automated ?
Back to top
View user's profile Send private message

steve-myers

Active User


Joined: 30 Nov 2013
Posts: 460
Location: The Universe

PostPosted: Wed Dec 03, 2014 6:07 am    Post subject:
Reply with quote

The first problem with this idea is something like 1202 is not a valid index element in a data set name. It must be something like D1202.

The second problem is it is entirely unnecessary. This is why generation data groups were invented nearly 50 years ago. I strongly recommend reading Appendix A. Generation Data Sets in "MVS JCL User's Guide" for your z/OS release.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7907
Location: Bellevue, IA

PostPosted: Wed Dec 03, 2014 6:30 am    Post subject:
Reply with quote

If you want the LLQ to be something like DEC14, you probably can use your site's job scheduler to do so. If you don't want to use the job scheduler, plan on writing a program in the language of your choice to generate the JCL, then submit the generated JCL via the internal reader. JCL doesn't really support many features and date manipulation is NOT one of the supported features.
Back to top
View user's profile Send private message
David Robinson

Active User


Joined: 21 Dec 2011
Posts: 175
Location: UK

PostPosted: Wed Dec 03, 2014 1:14 pm    Post subject:
Reply with quote

As Robert has said, using your scheduler to generate the date is the way to go on this, although whether a month format of MMM is supported out of the box may be another matter.

In TWS for example, the nearest you could get would be &CMM&CDD but that would give you a date such as 1203 not DEC03. Perhaps you could get the name of the source file changed?

Failing that (again, using TWS as an example) you would have to set up a JCL variable table that maps 01 to JAN, 02 to FEB, etc.
Back to top
View user's profile Send private message
chockalingam_rsp

New User


Joined: 13 Aug 2009
Posts: 43
Location: chennai

PostPosted: Wed Dec 03, 2014 10:10 pm    Post subject:
Reply with quote

Thank you all for your replies.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts Add system date inside of a PS file a... pramitdas DFSORT/ICETOOL 5 Sun Aug 28, 2016 12:06 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us