MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Passing Parameterstrings from JCL PROC to other JCL PROC

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 317
Topics: 50
Location: Germany

PostPosted: Thu Apr 15, 2004 11:17 am    Post subject: Passing Parameterstrings from JCL PROC to other JCL PROC Reply with quote

Hi,

following problem:


From a job a JCL PROCEDURE named PROCA is called with parameters.

example:

STEP10 EXEC PROCA, PARM='a,b,c'


Implementation of PROCA

PROCA PROC, PARM=,........
EXEC PROCB, PARM=&PARM


Implemenatation of PROCB

PROCB PROC, PARM=, .........
EXEC PROGRAM, PARM=&PARM


Passing the parameters as PARM='a,b,c' results to JCL Error, IEFC640I EXCESSIVE NUMBER OF POSITIONAL PARAMETERS ON THE EXEC STATEMENT.

The aphost. gets lost calling PROCB from PROCA, parameters for PROCB are PARM=A,B,C,............ JCL Error of course.

Using the syntax PARM=(A,B,C) (as explained in IBM's JCL Guide) results in the Problem, that the parameters for PROGRAM are (A,B,C). The parenth. are part of the PARM String. PROGRAM does not process the parentheses.

Has anybody a solution ?

Thanks for answer.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Apr 15, 2004 11:33 am    Post subject: Reply with quote

bauer,

A couple of corrections. You cannot use 'PARM' as a symbolic name. so you need to define it something else let us say PRM.

Now if you want to enclose a quote then you can do by enclosing the parm in 3 quotes.

If you want the parm='a,b,c' then you need to code like this.

Code:

STEP10 EXEC PROCA, PRM='''a,b,c'''


If you want parenthesis around the parm then code as follows.
Code:

STEP10 EXEC PROCA, PRM='''(a,b,c)'''


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 317
Topics: 50
Location: Germany

PostPosted: Thu Apr 15, 2004 11:59 am    Post subject: Reply with quote

kolusu,

passing the parameters using '''a,b,c''' passes the parameters from jcl to jcl proca, but passing then the parameters from proca to procb doesn't work.

Using '''(a,b,c)''' doesn't work.

The problem is, what the called program in PROCB doesn't process parentheses.

The next problem is (in my opinion), what there are several level of jcl procedures. All solutions with ''' etc. work only with one level. Nested JCL Procs seems toi be a problem.

Sorry, what I cann't agree with your solution, but thank you for your quick reply.

Regards,
bauer
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Apr 15, 2004 12:20 pm    Post subject: Reply with quote

bauer,

I missed the part that you are calling another proc within a proc.ok here is the solution for the passing parms to nested proc.

PROCA:
Code:

//PROCA    PROC PRM=' '           
//STEP0100 EXEC PROCB,PARM=&PRM   


In procB you are going to define the symbolic parameter as follows:

Code:

//PROCB    PROC PRM='&PRM'         
//STEP0100 EXEC PGM=SORT,PARM='&PRM' 


See the parm is defined as another symbolic.

Now from the JCl if you override the PRM symbolic
Code:

//RUN      EXEC PROCA,PRM='''(A,B,C)'''     


Now procB prm will have the value ='(A,B,C)'

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 317
Topics: 50
Location: Germany

PostPosted: Fri Apr 16, 2004 1:08 am    Post subject: Reply with quote

kolusu,

thank you very much for your reply.

Your solution works, but the program, called from PROCB, in your example the SORT program, doesn't accept the parentheses. The parentheses are part of the passed parameters, this is the problem.

The checked the JCL documentation, did some testing with different combinations of parentheses and aphostrops. But no solution.

We change now the called program to accept the parentheses.

If the called program is an IBM Tool, software from third party etc. and dosn't accept the parentheses (like IBM PL1 Compiler, Version 2.3), is this situation there is an big problem dealing with nested JCL procs.

regards,
bauer
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group