Trying to receive a JCL Parm in Easytrieve.
Why am I getting a S0C4 U0020 in ETRSM when calling EZTPX01?
I have the following coded in my Easytrieve program.
PARM-INFO W 17 A
PARM-LTH PARM-INFO 2 B
PARM-DATA PARM-INFO +2 15 A
PARM-ANALYSIS. PROC
*PARM-LTH=5
CALL EZTPX01 USING (PARM-REGISTER PARM-INFO)
END-PROC
The below PARM-REGISTER must be updated with the length of the PARM-INFO before calling EZTPX01.
43 PARM-ANALYSIS. PROC
44 *PARM-LTH=5 <==== uncomment this line of code
45 CALL EZTPX01 USING (PARM-REGISTER PARM-INFO)
The info on EZTPX01 section is dropped, because r11.x has a much better way to get parameters from the JCL. That’s the PROGRAM USING statement. The attached program shows how to do it . You can use a VARYING field if you don’t know the length of the parameters being passed.
DEFINE PARM-CODE S 3 A
DEFINE TEXT-FIELD W 15 A
PROGRAM NAME TESTIT USING PARM-CODE
EXECUTE JOB1
*
******************************************
* TEST PROGRAM TEST001.EZT USING PROGRAM *
* ACTIVITY TO GET PARM VALUE *
******************************************
*
JOB NAME JOB1 INPUT NULL
*
IF PARM-CODE EQ 'AAA'
TEXT-FIELD = 'FIRST VALUE'
ELSE
TEXT-FIELD = 'SECOND VALUE'
END-IF
*
DISPLAY 'PARM-FIELD = : ' PARM-CODE
STOP
EZTPX01 is still shipped for backward compatibility. Not just for compatibility mode, but also for new function mode. We don’t want client’s calls to this utility to fail. However, for new development there is an easier and better way.
We have no intention of dropping support for EZTPX01. However, we believe the PROGRAM USING statement is an easier and more standard way of obtaining parameters. In addition, it will work cross-platform, meaning Easytrieve for Unix, Windows, z/Linux, etc.
We didn’t want to confuse new developers with 2 separate ways, especially since the new one is preferred, so we want to steer them away from EZTPX01. However, it will probably always still be supported. We’re not asking users to migrate their programs – just to start using the improved method for new development (although they don’t have to).