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

Generate a PDS member name dynamically using Curr &Prev


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Senthilraj

New User


Joined: 26 Jun 2009
Posts: 5
Location: Chennai, India

PostPosted: Tue Sep 29, 2009 1:52 pm
Reply with quote

I have a PDS HIGHLVL.MIDLVL.LOWLVL. I have 3 members in this. CALE085S, CALE095S and CALE105S. Here the highlighted numbers are previous, current and next year values. I have to browse the current year and previous year member in my JCL.

This year I will need to browse HIGHLVL.MIDLVL.LOWLVL(CALE095S) and HIGHLVL.MIDLVL.LOWLVL(CALE105S).

Next year I will need to browse HIGHLVL.MIDLVL.LOWLVL(CALE105S) and HIGHLVL.MIDLVL.LOWLVL(CALE115S).

I have to pass the members HIGHLVL.MIDLVL.LOWLVL(CALE105S) & HIGHLVL.MIDLVL.LOWLVL(CALE115S) to my program as input files.

What is the best way to achieve this in JCL.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Sep 29, 2009 2:10 pm
Reply with quote

You have a typo in Your post...
the text says current and previous but the member names specify 09 and 10
will the cutover be on a fixed day ??

on dec 31, 2009 ...
prev 2008 curr 2009 nex 2010

on jan 01, 2010
prev 2009 curr 2010 next 2011

a smart trick would be to use a member alias
define three member aliases pointing
<prev> ==> CALE085S
<curr> ==> CALE095S
<next> ==> CALE105S.

the jcl will stay unchanged forever
//dd1 dd disp=shr,dsn=datasetname(<prev>)
//dd2 dd disp=shr,dsn=datasetname(<curr>)
//dd3 dd disp=shr,dsn=datasetname(<next>)
the jcl would be unaffected

just before starting the new year cycle, every year You should define the new aliases
after the dec 31 job cycle and before the jan 01 just redefine
<prev> ==> CALE095S
<curr> ==> CALE105S
<next> ==> CALE115S.

or, as an alternative work with Your scheduler support to use scheduler variables

with my proposal You can run the jobs outside the scheduler
Back to top
View user's profile Send private message
Senthilraj

New User


Joined: 26 Jun 2009
Posts: 5
Location: Chennai, India

PostPosted: Tue Sep 29, 2009 3:14 pm
Reply with quote

Hi Enrico,

Thanks for your response.

Though I am aware that using aliases would be the easiest way to do this, I am trying to avoid editing the JCL every year. I am looking at having the year being appended automatically into the member name during each run.

As per my requirement, we have a calendar schedule available in a PDS for previous, current and next year. I have a job that runs everyday to read the current year calendar and do some processing. There is another job which executes at the end of each year to calculate some processing for next year. So I thought, if I am able to somehow get the year dynamically, I would use datasetname(CALE&YY.5S) in the daily job.

Also, through a program, if I calculate and write the member name into a PS file, is it possible to use that file as reference in the PDS member name?

And yes, the daily and yearly jobs are run through Ca7 scheduler.

Thanks,
Senthil Raj.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Sep 29, 2009 3:49 pm
Reply with quote

Quote:
I am trying to avoid editing the JCL every year.


You are not editing the jcl, You simply change the alias
facin the same update issue You have for the scheduler variables

You can run the alias change at the same time You setup the new scheduler variables

most of the time the date related variables expecially at year end/beginning cannot depend on the real date
the year end/beginning window is usually longer than the daily window

most often happens that on jan 2 You have to run jobs where the <current> year is the preceeding one
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Generate random number from range of ... COBOL Programming 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts How to copy the -1 version of a membe... TSO/ISPF 4
No new posts Searching for a member but don't know... TSO/ISPF 6
No new posts Looking For a PDS Member Without Open... PL/I & Assembler 10
Search our Forums:

Back to Top