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

To create the dataset in jcl based on current date


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
khannay2k

New User


Joined: 24 Feb 2005
Posts: 28
Location: Bangalore

PostPosted: Thu May 05, 2005 12:55 pm
Reply with quote

Hi,

can any one lemme know the answer.

I want to create the dataset in jcl based on current date do u have any idea please let me know.


rajesh.
Back to top
View user's profile Send private message
pr_ibm

New User


Joined: 04 May 2005
Posts: 9

PostPosted: Thu May 05, 2005 1:36 pm
Reply with quote

Rajesh,

Question is not clear . Can you make it clear with example?

Thanks
Pr..
Back to top
View user's profile Send private message
ankyhunk

Moderator


Joined: 05 May 2005
Posts: 98
Location: Navi Mumbai, India

PostPosted: Fri May 06, 2005 11:56 am
Reply with quote

Temporary datasets are created with current date & time. You can put the current date value in the name of the dataset to be created.
Back to top
View user's profile Send private message
David P

Active User


Joined: 11 Apr 2005
Posts: 106
Location: Cincinnati Ohio

PostPosted: Fri May 06, 2005 1:43 pm
Reply with quote

Hi Ankur,
Can you please elaborate more on

"You can put the current date value in the name of the dataset to be created"

I want to know how exactly you go about it.

regards,
David.
Back to top
View user's profile Send private message
ankyhunk

Moderator


Joined: 05 May 2005
Posts: 98
Location: Navi Mumbai, India

PostPosted: Fri May 06, 2005 6:32 pm
Reply with quote

I meant that u can name the dataset manually according to current date. This can also be automated thru a REXX utility. Code will be something like this -
Code:

say 'Enter the source dataset name'
parse pull indd                     
say 'The target file will be.'     
todays_date = date('U')                                           
parse value todays_date with todays_mm '/' todays_dd '/' todays_yy
outdd = indd || '.D' ||  todays_dd || todays_mm                   
parse value outdd with t1 '.' t2 '.' t3                           
outdd = 'S4PROD.OVERRIDE.' || t3     
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Mon May 09, 2005 4:23 pm
Reply with quote

rajesh, in order to use a value for current date in the job, you will need to define a variable and assign a value to it for the date. Normally, this function is handled by your job scheduling system. However, to accomplish this outside of that environment, you can use the JCL SET command in your job immediately after the JOB statements:
Code:

//MYJOB JOB (....),CLASS=X<MSGCLASS=X
//*
//SET MYDATE=050905
//*
....
//STEPXXXX EXEC PGM=MYPGM
//SYSUT2   DD   DSN=MYHLQ.D&MYDATE,DISP=(,CATLG,DELETE),...
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Mon May 09, 2005 6:18 pm
Reply with quote

I want specify that JCL SET run only for JCL statements and not for instream DD.
i.e. if you want to delete a dataset with IDCAMS and specify the entry you desire, and it contain a variable as you can see in superk's sample, in conversion phase that variable is not converted.
Ususally the system scheduler convert jcl before the jes conversion! So.. if you need to delete it use a IEFBR14 or, as extreme solution, write a rexx source to have a dynamic and efficient solution.
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 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
No new posts To get the the current time DFSORT/ICETOOL 13
Search our Forums:

Back to Top