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 FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
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 To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm


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