How to get the actual length of the JCL EXEC PARM string

Document ID : KB000045264
Last Modified Date : 14/05/2018
Show Technical Document Details
Introduction:

Introduction:
Since CA Easytrieve 11.0 has been released, we recommend to use the USING parameter instead of the EZTPX01 program which could be used in former releases.
Here are some details from the CA Easytrieve 11.6 User Guide:
...
Executing Your Program Using Parameters
You can specify a parameter to pass using statements similar to the following:
DEFINE PARM-FIELD S 16 A PROGRAM NAME MY-PROGRAM USING PARM-FIELD
The PARM-FIELD field contains the data that you entered on the command line or specified in the LINK or TRANSFER statement or specified in the JCL (that is, // EXEC PGM=PROG,PARM='data value'). For portability with CA Easytrieve Report Generator in other operating environments, the data is placed in the USING field as is. This means that CA Easytrieve Report Generator attempts to pass the command line just as it received it before translation.
...
 
While it was possible to get the length value of the PARM string via EZTPX01, you cannot get that value with the USING method. Below is a little example how to determine its length.
 
 
Instructions:     
If execute EZTPA00 as follows
...
//EASY1   EXEC PGM=EZTPA00,REGION=0M,PARM='0123456789ABCDEF'
...
You will get the correct length of "16" using this code:
...
DEFINE JCL-PARM              S       100  A  VARYING     
*                                                        
PROGRAM NAME TESTPARM USING(JCL-PARM)                    
EXECUTE TESTPARM1                                         
*                                                        
JOB INPUT(NULL) NAME TESTPARM1                           
*                                                        
  DISPLAY 'JCL-PARM:        +' JCL-PARM '+'               
  DISPLAY 'JCL-PARM:LENGTH: +' JCL-PARM:LENGTH '+'       
*                                                        
STOP                                                     
...
You will see:
...
JCL-PARM:        +0123456789ABCDEF                                                                                  +
JCL-PARM:LENGTH: +    16 +                                                                                           
...

Instructions:
Please Update This Required Field