Execute PARM with more than 100 chars including variabl



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Execute PARM with more than 100 chars including variabl

Postby jcdm » Tue Mar 15, 2022 10:32 pm

Hello, I need to execute a jcl who PARM exceed more than 100 characters, some of this parameters are variables like &CICS&DB2&COMP

I modified JCL to execute PARM by DDPARM on a file, but i am not able to insert values with &CICS&DB2&COMP.

I guess maybe it is possible to capture variables on PARM creating some new steps, but I dunno how.

Any suggestion?
jcdm
 
Posts: 18
Joined: Fri Dec 10, 2021 4:39 pm
Has thanked: 1 time
Been thanked: 3 times

Re: Execute PARM with more than 100 chars including variabl

Postby Robert Sample » Tue Mar 15, 2022 11:57 pm

As long as you are using z/OS 2.1 or higher, access the MVS JCL Reference manual for your version of z/OS and investigate the PARMDD statement. It allows you to pass parameters longer than 100 characters into a program, but not in the JCl -- the parameters go into the DD statement.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Execute PARM with more than 100 chars including variabl

Postby jcdm » Wed Mar 16, 2022 2:41 am

Thank you Robert , use more tha. 100 is not the problem, problem os use more tha. 100 with &variable strings
jcdm
 
Posts: 18
Joined: Fri Dec 10, 2021 4:39 pm
Has thanked: 1 time
Been thanked: 3 times

Re: Execute PARM with more than 100 chars including variabl

Postby Robert Sample » Wed Mar 16, 2022 6:46 pm

Are the &variable values supposed to remain &variable or are you expecting them to be substituted? Post (using the Code button) the JCL you are using and the message(s) you are getting when you try to execute that JCL, please.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Execute PARM with more than 100 chars including variabl

Postby sergeyken » Wed Mar 16, 2022 8:04 pm

jcdm wrote:Thank you Robert , use more tha. 100 is not the problem, problem os use more tha. 100 with &variable strings


Try this:
PARMDD parameter

. . . . .
// EXPORT SYMNAMES=*
. . . . . . . .
//stepname EXEC PGM=progname,PARMDD=SPECPARM
//SPECPARM DD  *,SYMBOLS=EXECSYS
. . . parm values . . . &variable. other parms . . . .
//*
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 409
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 6 times
Been thanked: 40 times

Re: Execute PARM with more than 100 chars including variabl

Postby jcdm » Mon Mar 28, 2022 6:47 pm

Thank you so much sergeyken. It looks great, but now I am facing new issue.

JCL comes with 3 variables, and in this case one of the have data:

//STP0000 EXEC PROC=ELAXJCDM,
// CICS=,
// DB2=,
// COMP=',''SQL,CP(1148)'''

My PROC is like:

// EXPORT SYMLIST=(*)
// SET CICS=&CICS
// SET DB2=&DB2
// SET COMP=&COMP
//*
//COBOL EXEC PGM=IGYCRCTL,REGION=0M,TIME=1440,PARMDD=JCDM
...
//JCDM DD *,SYMBOLS=(JCLONLY)
ZD(NOPFD),VLR(COMPAT),LIST,MAP,DYN,TRUNC(BIN),APOST,
NOSQLC,AR(E),&CICS&DB2&COMP

But fails:

4 XX EXPORT SYMLIST=(*)
5 XX SET CICS=&CICS
IEFC653I SUBSTITUTION JCL - CICS=
6 XXCICS EXPORT EXPSET= GENERATED STATEME
7 XX SET DB2=&DB2
IEFC653I SUBSTITUTION JCL - DB2=
8 XXDB2 EXPORT EXPSET= GENERATED STATEME
9 XX SET COMP=&COMP
IEFC653I SUBSTITUTION JCL - COMP=,'SQL,CP(1148)'
10 XXCOMP EXPORT EXPSET= GENERATED STATEME
XX*
XX*

10 IEFC640I EXCESSIVE NUMBER OF POSITIONAL PARAMETERS IN THE VALUE FIELD OF THE SYMBOLIC PARAMETER
jcdm
 
Posts: 18
Joined: Fri Dec 10, 2021 4:39 pm
Has thanked: 1 time
Been thanked: 3 times

Re: Execute PARM with more than 100 chars including variabl

Postby sergeyken » Mon Mar 28, 2022 7:12 pm

Please, start using the Code button for your samples!

jcdm wrote:JCL comes with 3 variables, and in this case one of the have data:

//STP0000 EXEC PROC=ELAXJCDM,  
// CICS=,                      
// DB2=,                        
// COMP=',''SQL,CP(1148)'''


jcdm wrote:My PROC is like:

// EXPORT SYMLIST=(*)                                        
//  SET    CICS=&CICS                                        
//  SET    DB2=&DB2                                          
//  SET    COMP=&COMP                                        
//*                                                                                                                
//COBOL    EXEC PGM=IGYCRCTL,REGION=0M,TIME=1440,PARMDD=JCDM
 ...                        
//JCDM     DD *,SYMBOLS=(JCLONLY)                            
  ZD(NOPFD),VLR(COMPAT),LIST,MAP,DYN,TRUNC(BIN),APOST,      
     NOSQLC,AR(E),&CICS&DB2&COMP



This doesn't make any sense.
You are trying to assign to your SET-variables CICS, DB2, and COMP some previous values of the same variables.
It looks like &CICS and &DB2 are not yet defined, while previous value of COMP is very strange (COMP=,'SQL,CP(1148)').

What did you mean while coding this?
//  SET    CICS=&CICS                                        
//  SET    DB2=&DB2                                          
//  SET    COMP=&COMP            
 


1) There is no need to redefine the PROC parameters as new SET-variables within a procedure.
2) The complex value of COMP parameter cannot be assigned correctly to the new COMP variable according to the // SET statement requirements (RTFM)

Use the parameters of your PROC as they are, to substitute into your input stream
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 409
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 6 times
Been thanked: 40 times

Re: Execute PARM with more than 100 chars including variabl

Postby jcdm » Mon Mar 28, 2022 7:27 pm

Thank you for quick reply.

First JCL:
//COMPILATION JOB ,TIME=1440,                          
// MSGCLASS=H,MSGLEVEL=(1,1),REGION=0M,COND=(16,LT)  
//*                                                  
//STP0000 EXEC PROC=ELAXJCDM,                        
// CICS=,                                            
// DB2=,                                            
// COMP=',''SQL,CP(1148)'''        


comes from a compilation process. CICS; DB2 and COMP , could be filled or not and execute PROC ELAXJCDM where I am trying to get that variables.

In this case, comes in that way because I was using PARM value:

PARM=('ZD(NOPFD),VLR(COMPAT),LIST,MAP,DYN,TRUNC(BIN),APOST',
         'NOSQLC,AR(E)'&CICS&DB2&COMP)                      


IEFC653I SUBSTITUTION JCL - PGM=IGYCRCTL,REGION=0M,TIME=1440,PARM=('ZD(NOPFD),VLR(COMPAT),LIST,MAP,DYN,
TRUNC(BIN),APOST'
,'NOSQLC,AR(E)','SQL,CP(1148)')                                


But I need to put more that 100 chars including &CICS&DB2&COMP
jcdm
 
Posts: 18
Joined: Fri Dec 10, 2021 4:39 pm
Has thanked: 1 time
Been thanked: 3 times

Re: Execute PARM with more than 100 chars including variabl

Postby sergeyken » Tue Mar 29, 2022 12:48 am

jcdm wrote:Thank you for quick reply.

But I need to put more that 100 chars including &CICS&DB2&COMP


Please, read again my initial response (post #5 in this thread).

I have no intention to repeat the same answer again, and again.
Javas and Pythons come and go, but JCL and SORT stay forever.

These users thanked the author sergeyken for the post:
jcdm (Thu Mar 31, 2022 12:25 pm)
User avatar
sergeyken
 
Posts: 409
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 6 times
Been thanked: 40 times

Re: Execute PARM with more than 100 chars including variabl

Postby Robert Sample » Tue Mar 29, 2022 7:00 pm

I'm locking this topic. jcdm has not been able to explain just what is wanted and why the solutions we've provided won't work. Furthermore, the desire to have more than 100 characters in a PARM just plain won't work -- that's why IBM produced the PARMDD statement. From the MVS JCL Reference manual (SA23-1385):
Length: The length of the subparameters passed must not exceed 100 characters:
• Including any commas, which are passed to the processing program.
• Excluding any enclosing parentheses or apostrophes, which are not passed.
For example, PARM='P1,123,MT5' is received by the program as P1,123,MT5.
Commas: When you code more than one subparameter, separate the subparameters by commas and
enclose the subparameters in parentheses or apostrophes. For example, PARM=(P1,123,MT5) or
PARM='P1,123,MT5'.
Special characters and blanks: When a subparameter contains special characters or blanks, enclose it
in apostrophes and the other subparameters in parentheses, or enclose all the subparameters in
apostrophes. For example, PARM=(P50,'12+80') or PARM='P50,12+80'.
Code each apostrophe and ampersand that is part of the subparameter as two consecutive apostrophes
or ampersands. For example, code 3462&5 as PARM='3462&&5'.
However, if a subparameter contains a symbolic parameter, code a single ampersand. You can code the
symbolic parameter in apostrophes.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post