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

how to include current date in a dataset name


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Fri Jul 08, 2005 6:29 pm
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
Search our Forums:

Back to Top