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
 

 

SET value in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
maki_psg

New User


Joined: 28 Jan 2010
Posts: 47
Location: India

PostPosted: Wed Sep 19, 2012 3:06 pm    Post subject: SET value in JCL
Reply with quote

Hi,

For one of the requirements, I have to execute a job(e.g. TESTJOB1), which uses the older version of GDG. For e.g. In TESTJOB1, I have to use GDG version - USER.TESTGDG.SEP(-2),(-3),(-4),etc. However, the original job(JOB1), which creates a new GDG version USER.TESTGDG.SEP(+1) executes for a longer time and does not allow the TESTJOB1 to access -2,-3,-4 versions and TESTJOB1 waits for the datasets. Instead of referring to -2,-3,-4 versions, if I use the absolute GDG version number (E.g. USER.TESTGDG.SEP.G10001V00,USER.TESTGDG.SEP.G10002V00, USER.TESTGDG.SEP.G10003V00), TESTJOB1 will not wait for the datasets and executes succesfully. Here, JOB1 has the Exclusive hold of GDG base.

I have found a way to get the absolute GDG version number using the below IDCAMS statement.

//*****************************************************
//STEP0005 EXEC PGM=IDCAMS
//*****************************************************
//DD1 DD DSN=USER.TESTGDG.SEP(-2),DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
PRINT INFILE(DD1) COUNT(0) CHAR
/*

From STEP0005 output, I could get the absolute version number. However, I will have to identify a way to SET GDG version number to a symbolic variable as show below.

FILE1 -> Should contain the absolute GDG version number to be used like below.

//*****************************************************
//STEP0010 EXEC PGM=TESTPGM
//*****************************************************
//SYSOUT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT2 DD SYSOUT=*
//SYSUT1 DD DSN=&FILE1

Is there a way to read a file and store the value in SET variable?
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Sep 19, 2012 3:15 pm    Post subject:
Reply with quote

the only thing that can be modified during a job is the contents of a file that will be used in a later step.

for the 10 millionth time, jcl can not be modified after it is processed by the initiator.

also, can't quite get a handle on why step005 can access gdg(-5) but step0010 can not?
Back to top
View user's profile Send private message
maki_psg

New User


Joined: 28 Jan 2010
Posts: 47
Location: India

PostPosted: Wed Sep 19, 2012 3:33 pm    Post subject: Reply to: SET value in JCL
Reply with quote

Thanks for the reply, dbzTHEdinosauer

You were right. I would get the same "waiting for datasets" in STEP0005 itself. I will have to identify any other way to directly use the absolute GDG version number rather than using GDG references (-2,-3,-4,etc).
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Sep 19, 2012 3:46 pm    Post subject: Reply to: SET value in JCL
Reply with quote

Well, no you wouldn't get the same messages. You can't do it.

You'll need something which knows which dataset you want to create/amend the JCL which can then specify that dataset.

Easiest way is for that "something" is for it to be you. Otherwise, do something to break it up, particularly as presumably the IDCAMS step was not in the original JCL.
Back to top
View user's profile Send private message
David Robinson

Active User


Joined: 21 Dec 2011
Posts: 175
Location: UK

PostPosted: Wed Sep 19, 2012 5:04 pm    Post subject:
Reply with quote

Firstly, I would question the initial design. It seems a bit odd that you're trying to read earlier generations at the same time as creating a new (+1). What happens if one of the jobs starts at a different time, or runs quicker than usual? You will end up reading a different generation to what you expected.

If you really must do it, you could do a LISTCAT of the base, read the output with a Rexx or whatever to determine the absolute name of the generations that you want and generate some REPRO commands. You could then copy it to a work file that has a constant name.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Sep 19, 2012 6:51 pm    Post subject:
Reply with quote

I also share the same thoughts as of David and would question the initial design. Why do you want to execute both the Jobs simultaneously? Perhaps, it would help if you tell us what is that you want to achieve instead of what design you choose to do that.

And it's "generations", not "versions".
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Sep 19, 2012 11:25 pm    Post subject:
Reply with quote

Also I would take the time to learn and use the correct terminology when referring to a GDS
Back to top
View user's profile Send private message
maki_psg

New User


Joined: 28 Jan 2010
Posts: 47
Location: India

PostPosted: Thu Sep 20, 2012 10:37 am    Post subject: Reply to: SET value in JCL
Reply with quote

Hi David/Anuj, I am not bothered about the data in latest GDG version, which is created in JOB1. I will have to run TESTJOB1 and use earlier versions of GDG - (-2,-4,-6..) to see the average deviations for a particular period of time. Even if I point to a wrong GDG version, since I am going to consider the average deviations, the results would be more or less same...

As David had mentioned earlier, I think I need to write a REXX program to get the absolute GDG version number and then update the PDS, which contains the GDG references (-2,-4,-6,etc) with the absolute GDG versions.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Sep 20, 2012 11:23 am    Post subject: Re: Reply to: SET value in JCL
Reply with quote

maki_psg wrote:
Even if I point to a wrong GDG version, since I am going to consider the average deviations, the results would be more or less same...
If that's your motive and acceptable - why are you thinking this hard? Why not just execute your Test-Job once the other Job, JOB1, is over?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Thu Sep 20, 2012 12:39 pm    Post subject:
Reply with quote

maki_psg: do you realise that a GDG number is made up of 2 parts GXXXX which is the number and VYY which is the version? When you talk about a gdg version you are referring to VYY. If you really mean GXXXX then refer to GDG number - as you were told to do before.
Back to top
View user's profile Send private message
maki_psg

New User


Joined: 28 Jan 2010
Posts: 47
Location: India

PostPosted: Thu Sep 20, 2012 1:01 pm    Post subject: Reply to: SET value in JCL
Reply with quote

We need to identify the deviations and generate few reports based on TESTJOB1 irrespective of JOB1 completion. It is one of the rare scenarios anyone would come across.

Thanks for correcting me, Nic.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:



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