Using Symbolic parm in PROC's SYSTSIN



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

Using Symbolic parm in PROC's SYSTSIN

Postby Misha786 » Fri Nov 27, 2020 12:50 am

Hi All -
We have a requirement to replace an old way way of handling symbolic parm. So far, client used a DPSS subsystem to replace/handle the external parms passed from the JCL. Have a look in to the calling JCL and proc
JCL
//TERM     EXEC DB2CMD,                    
//         CMD=' -TERM UTILITY (AI.AIZ040)'
//*                                        


proc
***************************** Top of Data ***************
//DB2CMD   PROC SOUT='*',RGN=0M,                        
//         CMD=,CMD2='END',CMD3='END',CMD4='END',SSN=' '
//DB2SYS   INCLUDE MEMBER=$DB2SYS&SSN                    
//TMP      EXEC PGM=IKJEFT01,DYNAMNBR=200,REGION=&RGN    
//SYSTSIN  DD SUBSYS=(DPSS,'CARD(DSN ',                  
// 'SYSTEM(&$DB2SYS) #',                                
// '&CMD #',                                            
// '&CMD2 #',                                            
// '&CMD3 #',                                            
// '&CMD4 #',                                            
// 'END )')                                              
//SYSTSPRT     DD SYSOUT=&SOUT                          
//SYSPRINT     DD SYSOUT=&SOUT                          
//SYSIN        DD DUMMY                                  
//ENQUEUE      DD DSN=&$DB2SYS..DB2CATLG.ENQUEUE,DISP=SHR
**************************** Bottom of Data *************


This proc has been called by many JCL's.
Now, the clients is trying to get rid of that DPSS stuff altogether and want to use symbolic parm instead. I tried to use SET statement but it is truncating the values. fro example, CMD is getting value as -TERM instead of full statement i.e. -TERM UTILITY (AI.AIZ040)

I know that we can add a rexx pgm at the begining of the proc to resolve the passed values. But, I want to know if it is possible to resolve the issue without adding any additional step in the proc.
Experts, please suggest if this is possible.
Misha786
 
Posts: 31
Joined: Fri Nov 27, 2020 12:28 am
Has thanked: 0 time
Been thanked: 0 time

Re: Using Symbolic parm in PROC's SYSTSIN

Postby sergeyken » Fri Nov 27, 2020 2:13 am

Present the exact code sample: where the value of JCL parameter is truncated?
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 430
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times

Re: Using Symbolic parm in PROC's SYSTSIN

Postby Misha786 » Fri Nov 27, 2020 8:50 pm

Hi sergeyken -

Here is the code I am trying
JCL
***************************** Top of Data *********
//T3CMD   JOB (D03,07SU),'COPY MEMBERS',          
//         MSGCLASS=E,NOTIFY=&SYSUID              
/*JOBPARM  SYSAFF=SI10                            
//  JCLLIB ORDER=TU.C11T.PROCLIB                  
//DB2CMD   EXEC  DB2CMD,CMD='-TERM UTILITY (T3PLI)'
//                                                
**************************** Bottom of Data *******


Proc
***************************** Top of Data ***************
//DB2CMD   PROC SOUT='*',RGN=0M,                        
//         CMD=,CMD2='END',CMD3='END',CMD4='END',SSN=' '
//*                                                      
//DB2SYS   INCLUDE MEMBER=$DB2SYS&SSN                    
//*                                                      
//VAREXP EXPORT SYMLIST=($DB2SYS,CMD,CMD2,CMD3,CMD4)    
//       SET $DB2SYS=&$DB2SYS                            
//       SET CMD=&CMD                                    
//       SET CMD2=&CMD2                                  
//       SET CMD3=&CMD3                                  
//       SET CMD4=&CMD4                                  
//*                                                      
//TMP      EXEC PGM=IKJEFT01,DYNAMNBR=200,REGION=&RGN    
//SYSTSIN  DD  *,SYMBOLS=EXECSYS                        
 DSN SYSTEM(&$DB2SYS)                                    
 &CMD                                                    
 &CMD2                                                  
 &CMD3                                                  
 &CMD4                                                    
 END                                                      
/*                                                        
//SYSTSPRT     DD SYSOUT=&SOUT                            
//SYSPRINT     DD SYSOUT=&SOUT                            
//SYSIN        DD DUMMY                                    
//ENQUEUE      DD DSN=&$DB2SYS..DB2CATLG.ENQUEUE,DISP=SHR  
**************************** Bottom of Data ***************


Error message .. See only -TERM has come along. Full value i.e. -TERM UTILITY (T3PLI) has been truncated after the first space.
SDSF OUTPUT DISPLAY T3CMD    JOB03721  DSID   102 LINE 0       COLUMNS
 COMMAND INPUT ===>                                            SCROLL =
********************************* TOP OF DATA *************************
ACF0C038 ACF2 LOGONID ATTRIBUTES HAVE REPLACED DEFAULT USER ATTRIBUTES
READY                                                                  
 DSN SYSTEM(BDS0)                                                      
DSN                                                                    
 -TERM                                                                
DSN9009I  - KEYWORD 'UTILITY' IS MISSING AND MUST BE SPECIFIED        
DSN9023I  - DSN9SCND '-TERM ' ABNORMAL COMPLETION                      
DSN                                                                    
 END                                                                  
READY                                                                  
 END                                                                  
READY                                                                  
 END                                                                  
READY                                                                  
 END                                                                  
READY                                                                  
END                                                                    
******************************** BOTTOM OF DATA ***********************
Misha786
 
Posts: 31
Joined: Fri Nov 27, 2020 12:28 am
Has thanked: 0 time
Been thanked: 0 time

Re: Using Symbolic parm in PROC's SYSTSIN

Postby prino » Fri Nov 27, 2020 10:01 pm

Submit the job with MSGLEVEL=(1,1) and look at all output generated, I'm pretty sure you will see what's happening. Don't want to log on to z/OS now to verify that I'm right.
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 641
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 29 times

Re: Using Symbolic parm in PROC's SYSTSIN

Postby sergeyken » Sat Nov 28, 2020 4:51 am

Use
//DEBUGLST DD SYSOUT=*
//SYSTSIN DD *,SYMBOLS=(EXECSYS,DEBUGLST)

to trace in details all symbols substitution.
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 430
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times

Re: Using Symbolic parm in PROC's SYSTSIN

Postby Misha786 » Sat Nov 28, 2020 9:27 pm

Hi Sergeyken -
Here is the JCL with MSGLEVEL=(1,1) and proc with dd that you suggested. I have also mentioned the substitution values from spool/log. Result is same as before. Please let me know if you see the reason/solution to this issue

JCL
***************************** Top of Data **********
//T3CMD   JOB (D03,07SU),'COPY MEMBERS',            
//         MSGCLASS=E,NOTIFY=&SYSUID,MSGLEVEL=(1,1)
/*JOBPARM  SYSAFF=SI10                              
//  JCLLIB ORDER=TU.C11T.PROCLIB                    
//DB2CMD   EXEC  DB2CMD#,CMD='-TERM UTILITY (T3PLI)'
**************************** Bottom of Data ********


Proc with DEBUGLST dd
***************************** Top of Data **************
//DB2CMD   PROC SOUT='*',RGN=0M,                        
//         CMD=,CMD2='END',CMD3='END',CMD4='END',SSN=' '
//*                                                    
//DB2SYS   INCLUDE MEMBER=$DB2SYS&SSN                  
//*                                                    
//VAREXP EXPORT SYMLIST=($DB2SYS,CMD,CMD2,CMD3,CMD4)    
//       SET $DB2SYS=&$DB2SYS                          
//       SET CMD=&CMD                                  
//       SET CMD2=&CMD2                                
//       SET CMD3=&CMD3                                
//       SET CMD4=&CMD4                                
//*                                                    
//TMP      EXEC PGM=IKJEFT01,DYNAMNBR=200,REGION=&RGN  
//DEBUGLST DD SYSOUT=*                                  
//SYSTSIN  DD  *,SYMBOLS=(EXECSYS,DEBUGLST)            
 DSN SYSTEM(&$DB2SYS)                                  
 &CMD                                                  
 &CMD2    
 &CMD3                                                    
 &CMD4                                                    
 END                                                      
/*                                                        
//SYSTSPRT     DD SYSOUT=&SOUT                            
//SYSPRINT     DD SYSOUT=&SOUT                            
//SYSIN        DD DUMMY                                  
//ENQUEUE      DD DSN=&$DB2SYS..DB2CATLG.ENQUEUE,DISP=SHR
**************************** Bottom of Data **************                                            
 


Values substituted for symbolic parms( as in spool ). CMD value is - TERM which is incomplete (it should have been complete value : -TERM UTILITY (T3PLI) )
For CMD2,3 4 the values (i.e. END) are correctly substituted . There is nothing coming in SYSOUT for DEBUGLST. Spool only shows SYSTSPRT and it's content i have already post in my last reply. Please let me know if you see the reason or solution to this.
11 XXDB2SYS   INCLUDE MEMBER=$DB2SYS&SSN                                
   XX* - -  DB2 SYSTEM-SPECIFIC VARIABLES - DEFAULTS FOR DEV SYSTEM - -
   IEFC653I SUBSTITUTION JCL - MEMBER=$DB2SYS                          
12 XXDB2PREF  SET $DB2PREF=BDB2                   DB2 DATASET PREFIX    
13 XXDB2SYS   SET $DB2SYS=BDS0                    DB2 SYSTEM ID        
   XX* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
   XX*                                                                  
14 XXVAREXP EXPORT SYMLIST=($DB2SYS,CMD,CMD2,CMD3,CMD4)                
15 XX       SET $DB2SYS=&$DB2SYS                                        
   IEFC653I SUBSTITUTION JCL - $DB2SYS=BDS0                            
16 XX$DB2SYS  EXPORT EXPSET=BDS0                        GENERATED STATEM
17 XX       SET CMD=&CMD                                                
   IEFC653I SUBSTITUTION JCL - CMD=-TERM                                
18 XXCMD      EXPORT EXPSET=-TERM                       GENERATED STATEM
19 XX       SET CMD2=&CMD2                                              
   IEFC653I SUBSTITUTION JCL - CMD2=END                                
20 XXCMD2     EXPORT EXPSET=END                         GENERATED STATEM
21 XX       SET CMD3=&CMD3                                              
   IEFC653I SUBSTITUTION JCL - CMD3=END                                
22 XXCMD3     EXPORT EXPSET=END                         GENERATED STATEM
23 XX       SET CMD4=&CMD4                                              
   IEFC653I SUBSTITUTION JCL - CMD4=END                                
24 XXCMD4     EXPORT EXPSET=END                         GENERATED STATEM
Misha786
 
Posts: 31
Joined: Fri Nov 27, 2020 12:28 am
Has thanked: 0 time
Been thanked: 0 time

Re: Using Symbolic parm in PROC's SYSTSIN

Postby sergeyken » Sun Nov 29, 2020 2:32 am

WHERE IS THE LISTING FROM //DEBUGLST DD SYSOUT=*
???
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 430
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times

Re: Using Symbolic parm in PROC's SYSTSIN

Postby sergeyken » Sun Nov 29, 2020 6:42 am

There is no need to re-assign the value of PROC parameter CMD= (as well as any other parameter) to the JCL SET variable with the same name CMD=. Just use substitution of &CMD where needed: in JCL statements, an in input stream data as well.

In the used form there are strict restrictions on the values allowed to be re-assigned.

Do not forget to use
// EXPORT SYMLIST=*
Before the EXEC statement calling your procedure.

Do not create unneeded problems for yourself. What is the idea to re-assign parameters to the same-named SET variables? :?
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 430
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times

Re: Using Symbolic parm in PROC's SYSTSIN

Postby Misha786 » Sun Nov 29, 2020 5:48 pm

Hi Sergeyken -
Thanks for your suggestions !!
It works when I use // EXPORT SYMLIST=* (in the JCL/JOB) before the EXEC statement calling my PROC and remove the SET statements altogether from the PROC.
But, as this proc is being called by 400 + Jobs, the impact is huge. It will need us to change all these JCL's to add // EXPORT SYMLIST=*
That is the reason I am trying to find a solution (if at all possible !! ) that will enable us
a. not to touch the Jobs
b. not to add any additional step at the beginning of the proc
But SET statement seems to be an issue which is not capable of handling special kind of values (such as a string with space, ; , _ etc. ) passed from the calling JOB. I tried with SET variables with different names (such as COM, COM2, COM3 etc. instead of CMD, CMD2, CMD3 etc) but that too did not help.
Only solution that worked is as below (suggested by you ), but no. of jobs needed change is huge.

So, Please let me know if you have any idea that can address the issue keeping in mind point# a and b as mentioned above. Thanks a lot Sergeyken for all your helps !!!! Much appreciated. !!!

JCL
***************************** Top of Data **
//DB2CMD  JOB (D03,07SU),'DPSS REPLACE',    
//         MSGCLASS=E,NOTIFY=M958          
/*JOBPARM  SYSAFF=SI10                      
//  JCLLIB ORDER=TU.C11T.M958.DPSS.PROCLIB  
//*                                        
// EXPORT SYMLIST=*                        
//*                                        
//STOPPROC EXEC DB2CMD,                    
//         CMD='-TERM UTILITY (T3PLI)'      
**************************** Bottom of Data


PROC
   TU.C11T.M958.DPSS.PROCLIB(DB2CMD) - 01.04       Colu
 ===>                                                  S
***************************** Top of Data **************
//DB2CMD   PROC SOUT='*',RGN=0M,                        
//         CMD=,CMD2='END',CMD3='END',CMD4='END',SSN=' '
//*                                                    
//DB2SYS   INCLUDE MEMBER=$DB2SYS&SSN                  
//*                                                    
//TMP      EXEC PGM=IKJEFT01,DYNAMNBR=200,REGION=&RGN  
//DEBUGLST DD SYSOUT=*                                  
//SYSTSIN  DD  *,SYMBOLS=(EXECSYS,DEBUGLST)            
 DSN SYSTEM(&$DB2SYS)                                  
 &CMD                                                  
 &CMD2                                                  
 &CMD3                                                  
 &CMD4                                                  
 END                                                    
/*                                                      
//SYSTSPRT     DD SYSOUT=&SOUT                          
//SYSPRINT     DD SYSOUT=&SOUT                          
//SYSIN        DD DUMMY                                
//ENQUEUE      DD DSN=&$DB2SYS..DB2CATLG.ENQUEUE,DISP=SHR
**************************** Bottom of Data *************


Replacement happens correctly (spool)
SDSF OUTPUT DISPLAY DB2CMD   JOB09378  DSID   106 LINE 0       COLUMNS
 COMMAND INPUT ===>                                            SCROLL =
********************************* TOP OF DATA *************************
ACF0C038 ACF2 LOGONID ATTRIBUTES HAVE REPLACED DEFAULT USER ATTRIBUTES
READY                                                                  
 DSN SYSTEM(BDS0)                                                      
DSN                                                                    
 -TERM UTILITY (T3PLI)                                                
DSNU112I  - DSNUGDIS - NO AUTHORIZED UTILITY FOUND FOR UTILID = T3PLI  
DSN9022I  - DSNUGCCC '-TERM UTILITY' NORMAL COMPLETION                
DSN                                                                    
 END                                                                  
READY                                                                  
 END                                                                  
READY                                                                  
 END                                                                  
READY                                                                  
 END                                                                  
READY                                                                  
END                                                                    
******************************** BOTTOM OF DATA ***********************
Misha786
 
Posts: 31
Joined: Fri Nov 27, 2020 12:28 am
Has thanked: 0 time
Been thanked: 0 time

Re: Using Symbolic parm in PROC's SYSTSIN

Postby sergeyken » Sun Nov 29, 2020 7:03 pm

There is not to much to choose from.

1. The statement // EXPORT must be used in JCL before either JCL PROC parameters, or SET variables have been assigned their values

2. Any value with special characters (those requiring quotes around) cannot be re-assigned to another variable/parameter.

3. Mass update of huge number of JCLs and/or PROCs in the libraries is not too complicated. I did it many times in my life, either via REXX script(s), or even in batch, using sequentially the standard utilities: IEBPTPCH-SORT-IEBUPDTE. But this is a different story for a different topic.
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 430
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post