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 Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm


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