Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to pass a Parameter to a JCl?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to pass a Parameter to a JCl?
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: 8593
Location: Back in jolly old England

PostPosted: Fri Nov 16, 2007 1:08 pm    Post subject:
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: 130
Location: Guntur

PostPosted: Fri Nov 16, 2007 1:09 pm    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Fri Nov 16, 2007 3:10 pm    Post subject: Reply to: How to pass a Parameter to a JCl?
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    Post subject:
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: 130
Location: Guntur

PostPosted: Mon Nov 19, 2007 6:32 pm    Post subject:
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    Post subject:
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: 2360
Location: Israel

PostPosted: Thu Nov 22, 2007 2:02 pm    Post subject:
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    Post subject:
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    Post subject:
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: 2360
Location: Israel

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

No.

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

New User


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

PostPosted: Fri Nov 23, 2007 2:45 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Regarding time parameter shanthi gude JCL & VSAM 7 Mon Sep 04, 2017 2:31 pm
No new posts Paasing symbolic parameter to instrea... Robert Sample JCL & VSAM 2 Thu Jul 27, 2017 1:22 pm
No new posts JTS parameter Shashank Chaubey JCL & VSAM 2 Thu Jul 13, 2017 4:15 pm
No new posts Include/omit with "ALL" pa... mgl DFSORT/ICETOOL 6 Wed Jun 14, 2017 2:31 pm
No new posts Can DFSPARM override SORTKEYS paramet... ashek15 DB2 2 Tue Jan 31, 2017 11:36 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us