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
 

 

To create the dataset in jcl based on current date

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
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    Post subject: To create the dataset in jcl based on current date
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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

Moderator Team Head


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

PostPosted: Mon May 09, 2005 4:23 pm    Post subject: Re: data set creation
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    Post subject:
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    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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
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. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm


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