Get the actual length of the JCL EXEC PARM string
search cancel

Get the actual length of the JCL EXEC PARM string

book

Article ID: 45264

calendar_today

Updated On:

Products

Easytrieve Report Generator

Issue/Introduction

Since Easytrieve 11.x has been released, we recommend to use the USING parameter instead of the EZTPX01 program which could be used in former releases.

Resolution

Here are the details from the Easytrieve Report Generator 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 Easytrieve Report Generator in other operating environments, the data is placed in the USING field as is. This means that 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 +