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
 

 

how to include current date in a dataset name

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
t1nt1n

New User


Joined: 08 Jul 2005
Posts: 31

PostPosted: Fri Jul 08, 2005 2:50 pm    Post subject: how to include current date in a dataset name
Reply with quote

I have a scenario say my job creates a dataset daily for processing. How can i concatenate the current date to the dataset name ? - this was asked ina interview
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Fri Jul 08, 2005 6:29 pm    Post subject: Re: how to include current date in a dataset name
Reply with quote

One of the easiest ways is to set a variable to the date value at the beginning of the job, and then use that variable when the dataset is created:
Code:

//MYJOB JOB (...),CLASS=X,MSGCLASS=X
//*
// SET MMDDYY=070805
//*
...
//SYSUT2 DD DSN=HLQ1.HLQ2.D&MMDDYY,DISP=(,CATLG,DELETE),...
Back to top
View user's profile Send private message
brain_s390

New User


Joined: 06 May 2005
Posts: 58
Location: Mumbai

PostPosted: Sat Jul 09, 2005 4:42 pm    Post subject: Re: how to include current date in a dataset name
Reply with quote

Hi,

Here it will be hardcoded in the JCL and daily programmer will need to change the date.

//MYJOB JOB (...),CLASS=X,MSGCLASS=X
//*
// SET MMDDYY=070805
//*
...
//SYSUT2 DD DSN=HLQ1.HLQ2.D&MMDDYY,DISP=(,CATLG,DELETE),...

Instead of this we can do this thru COBOL pgm where it will move system date in the last qualifier of the dataset.
Back to top
View user's profile Send private message
t1nt1n

New User


Joined: 08 Jul 2005
Posts: 31

PostPosted: Wed Jul 20, 2005 12:10 pm    Post subject:
Reply with quote

Thanks Superk & brain S390
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts Want to pull the job log into a Mainf... Jishu Mukherjee Compuware & Other Tools 9 Tue Mar 21, 2017 4:48 pm
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts Overlay the system date Danielle.Filteau SYNCSORT 4 Fri Mar 03, 2017 1:16 am


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