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

How to pass a Parameter to a JCl?


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

New User


Joined: 07 Mar 2007
Posts: 40
Location: India

PostPosted: Fri Nov 16, 2007 12:52 pm
Reply with quote

I need to perform a series of PDS Copy steps, but the PDS names will be different each time which i need to provide as a parameter
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Fri Nov 16, 2007 1:08 pm
Reply with quote

Read the JCl manual, and pay attention to the PROC statement and then try and build an instream PROC in which you can define the symbolics that are required, and then execute the PROC with the symbolics adjusted for any PDS.
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 128
Location: Guntur

PostPosted: Fri Nov 16, 2007 1:09 pm
Reply with quote

Hi Deepthy,

Better to use rexx code for your requirement.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Nov 16, 2007 3:10 pm
Reply with quote

Deepthy,

Quote:
I need to perform a series of PDS Copy steps, but the PDS names will be different each time


As suggested, Use REXX to build your JCL which has an instream proc.

If the first few qualifiers of the PDS are the same then u can use LMDLIST to expand. If the qualifiers are different then store it a flat file and read that file and set-up the JCL.
Back to top
View user's profile Send private message
Deepthy Jose P

New User


Joined: 07 Mar 2007
Posts: 40
Location: India

PostPosted: Mon Nov 19, 2007 5:53 pm
Reply with quote

My actual requirement is like i have a set of PDS names which i need to copy using a JCL. but the middle level qualifier of the PDS 's changes for each execution.
XXX.val1.YYY
AAA.val1.BBB
GGG.val1.HHH

the value for the val1 changes for each execution

How to specify it through JCL.
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 128
Location: Guntur

PostPosted: Mon Nov 19, 2007 6:32 pm
Reply with quote

Hi Deepthy,

Put all the pds names in a sequential file and read that file and unstring the name of the file with "." as delimiter and get the second qualifier and use it to override for each and every call of the proc which will copy that pds file to another file use the same qualifier in the file to which you are copying so that it will not get override in the same file for the next execution.
Back to top
View user's profile Send private message
Deepthy Jose P

New User


Joined: 07 Mar 2007
Posts: 40
Location: India

PostPosted: Thu Nov 22, 2007 1:51 pm
Reply with quote

Is it possible to give a symbolic parameter in a SYSIN statement?

say

//COPYSTP1.SYSINDD *
*
$$DD01 COPY OUT=0,EDITALLl=(1,0,C'ABCD',C'WXYZ')

can i use a parameter in place of the second string 'WXYZ' like


$$DD01 COPY OUT=0,EDITALLl=(1,0,C'ABCD',&TRIAL)

Where TRIAL is defined in an instream proc within the JCL. or is there any other way to give the parameter value in the sysin statement
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Thu Nov 22, 2007 2:02 pm
Reply with quote

Why don't you try it and let us know? icon_biggrin.gif

O.
Back to top
View user's profile Send private message
Deepthy Jose P

New User


Joined: 07 Mar 2007
Posts: 40
Location: India

PostPosted: Thu Nov 22, 2007 2:49 pm
Reply with quote

I tried giving the same statement but didnt workout? is there any other way?
Back to top
View user's profile Send private message
Deepthy Jose P

New User


Joined: 07 Mar 2007
Posts: 40
Location: India

PostPosted: Thu Nov 22, 2007 3:24 pm
Reply with quote

There is a correction in the code in the above query (TYPO error)

//COPYSTP1.SYSINDD *
*
$$DD01 COPY OUT=0,EDITALL=(1,0,C'ABCD',C'WXYZ')

can i use a parameter in place of the second string 'WXYZ' like


$$DD01 COPY OUT=0,EDITALL=(1,0,C'ABCD',&TRIAL)
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Thu Nov 22, 2007 3:45 pm
Reply with quote

No.

O.
Back to top
View user's profile Send private message
Rod Hittle

New User


Joined: 21 Nov 2007
Posts: 4
Location: Omaha, NE USA

PostPosted: Fri Nov 23, 2007 2:45 am
Reply with quote

Deepthy, you asked 'Is it possible to give a symbolic parameter in a SYSIN statement?' and ofer71 said 'no'. He is correct if you stick to just having JCL code in a 'job' or even a job executing a proc.

There is no way around this that I have discovered. BUT, if you can code a REXX macro (you can do this in COBOL too) you can make a macro that dynamically creates the job/JCL (typically a PDS member but could be a single flat file). In that macro you can very the node for files you want to change to do the copy. I typically do this using a REXX macro and a 'skeleton'. The symbolic variable is picked up by the skeleton if in the skeleton the 'word' has a '&' in front of it. Just like in a job/proc relationship. With REXX you can even have it come up with an on-screen panel (like CICS) where you can supply the value for the variable, the REXX marco would pick that up and assign it to the variable, and pass it on to the JCL created using the skeleton previously made. All this can be done with COBOL too, but more of a bother in my opinion.
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 Is this possible via sort (in one pass)? SYNCSORT 4
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Using the Jobname parameter in a Qual... ABENDS & Debugging 1
No new posts Demand with DEADLINE TIME parameter CA Products 4
Search our Forums:

Back to Top