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 comma - separated parameters to jcl procedures

 
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: 315
Topics: 49
Location: Germany

PostPosted: Tue May 15, 2007 3:19 am    Post subject: Passing comma - separated parameters to jcl procedures Reply with quote

Hi all,

given is the following JCL, in this sample coded as instream procedures, really this procedures are different members on any proclib.

Code:


//TEST2 PROC DATA1='X1,X2,',DATA2=''
//S020  EXEC PGM=MYPROG,PARM='/&DATA1.&DATA2'
//      PEND
//*
//TEST1 PROC DATA2=''
//S010  EXEC TEST2,DATA2=&DATA2
//      PEND
//*
//S099    EXEC  TEST1,DATA2='X3,X4,X5'
//*




Step S099 calls procedure TEST1, procedure TEST1 calls procedure TEST2, TEST2 calls any program. This program expects parameters separated by comma.

The desired result is, to pass the parameters X3, X4, X5 in addition to the default parameters X1, X2 to MYPROG.

The current result is


Code:


STMT NO. MESSAGE
       4 IEFC001I PROCEDURE TEST1 WAS EXPANDED USING INSTREAM PROCEDURE DEFINITION
       6 IEFC640I EXCESSIVE NUMBER OF POSITIONAL PARAMETERS ON THE EXEC STATEMENT
       6 IEFC640I EXCESSIVE NUMBER OF POSITIONAL PARAMETERS ON THE EXEC STATEMENT
       6 IEFC657I THE SYMBOL DATA2 WAS NOT USED


2 //TEST2 PROC DATA1='X1,X2,',DATA2=''
  //S020  EXEC PGM=MYPROG,PARM='/&DATA1.&DATA2'
  //      PEND
  //*
3 //TEST1 PROC DATA2=''
  //S010  EXEC TEST2,DATA2=&DATA2
  //      PEND
  //*
4 //S099    EXEC  TEST1,DATA2='X3,X4,X5'
5 ++TEST1 PROC DATA2=''
6 ++S010  EXEC TEST2,DATA2=&DATA2
  //*
  IEFC653I SUBSTITUTION JCL - TEST2,DATA2=X3,X4,X5





Any comments about the correct syntax to handle this situation ?


regards,
bauer
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Tue May 15, 2007 3:41 am    Post subject: Reply with quote

1) NEVER EVER, if you can possibly help it, nest procedures
2) Use triple quotes :
Code:
//s099 exec test1,data2='''x3,x4.x5'''

If you look you will see your substitution is
Code:
TEST2,DATA2=X3,X4,X5
and you want
Code:
TEST2,DATA2='X3,X4,X5'

_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 315
Topics: 49
Location: Germany

PostPosted: Tue May 15, 2007 4:03 am    Post subject: Reply with quote

Nic Clouston,

this was a really quick answer and you are right, this works. Thank you very much.

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