IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Pass Date in the DSN as MMMDD ina JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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 Member


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

PostPosted: Wed Dec 03, 2014 6:07 am
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Dec 03, 2014 6:30 am
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: 199
Location: UK

PostPosted: Wed Dec 03, 2014 1:14 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top