Using EZTPX01 with Easytrieve R11.6
search cancel

Using EZTPX01 with Easytrieve R11.6

book

Article ID: 43701

calendar_today

Updated On:

Products

Easytrieve Report Generator

Issue/Introduction

Please provide information on where EZTPX01 is documented or if it is still supported for Easytrieve release 11.6.  Is there a sample program/JCL for this?

 

 

Environment

Easytrieve Report Generator, release 11.6

Resolution

The documentation section on EZTPX01 is not included in the documentation for release 11.6 because 11.6 has a much better functionality now to get parameters from the JCL. This is the PROGRAM USING statement. 

EZTPX01 is still shipped for backward compatibility, of course. Not just for compatibility mode, but also for new function mode so that any programs which have a call to this EZTPX01 utility coded in the programs does not fail.
However, for new development this is an easier and better way. 

There is no intention of dropping support at this time for EZTPX01.  However, using the PROGRAM USING statement is an easier and more standard way of obtaining parameters.
In addition, it will work across platforms, meaning Easytrieve for Unix, Windows, z/Linux, etc.
 

The following is documentation on how to use EZTPX01 

Processing JCL Parameters 

This example obtains a parameter coded on a JCL EXEC statement and uses it to control the selection of records. 

A START procedure receives control at the beginning of the job. This procedure calls a subprogram that moves the PARM information into a Easytrieve  

field. A JCL parameter can be from 1 to 100 characters long. The maximum length of the field you defined (PARM-DATA in this case) must be specified in 

PARM-LTH. The subprogram, EZTPX01, moves up to 10 characters from the JCL PARM-DATA, in this example. 

 

If no JCL parameter is specified on the EXEC statement, PARM-LTH includes a zero after calling EZTPX01. If more than 10 characters are specified, the PARM is 

truncated to 10 characters. 

In this example (see below), the expected JCL parameter is defined to be three digits; the first digit specifies the region number and the next two contain the branch number. 

The format and content of the parameter is validated after calling EZTPX01. A PARM-LTH of 10 was used to detect either a missing JCL parameter or one that 

is not the correct length. If PARM-LTH = 3 was coded, a parameter longer than 3 could not be detected, since EZTPX01 would truncate it to three characters. 

Note: The use of field redefinition defines subfields of the JCL parameter. The value of the JCL parameter is 302 for this example.  

1 * 

2 * EXAMPLE 15.14 

3 * 

4 FILE PERSNL FB(150 1800) 

5 %PERSNL 

35 * 

36 * JCL PARM DECODE DEFINITIONS 

37 * 

38 PARM-INFO W 12 A 

39 PARM-LTH PARM-INFO 2 B 

40 PARM-DATA PARM-INFO +2 10 A 

41 * 

42 SELECT-REGION PARM-DATA 1 N 

43 SELECT-BRANCH PARM-DATA +1 2 N 

44 * 

45 * 

46 JOB START(PARM-ANALYSIS) 

47 IF REGION = SELECT-REGION AND BRANCH = SELECT-BRANCH 

48 PRINT 

49 END-IF 

50 * 

51 * MOVE THE JCL PARM INTO THE PARM-INFO W-FIELD AND VALIDATE IT 

52 * 

53 * THE JCL PARM MUST BE 3 DIGITS OF THE FORM RBB 

54 * WHERE R IS THE REGION NUMBER AND BB IS THE BRANCH NUMBER 

55 * 

56 PARM-ANALYSIS. PROC 

58 PARM-LTH = 10 

59 CALL EZTPX01 USING (PARM-REGISTER PARM-INFO) 

61 DISPLAY SKIP 3 '******* MISSING OR INVALID JCL PARM' 

62 STOP EXECUTE 

63 END-IF 

64 IF SELECT-REGION NE 1 THRU 4 

65 DISPLAY SKIP 3 '******* INVALID REGION NUMBER' 

66 STOP EXECUTE 

67 END-IF 

68 IF SELECT-BRANCH NE 1 THRU 5 

69 DISPLAY SKIP 3 '******* INVALID BRANCH NUMBER' 

70 STOP EXECUTE 

71 END-IF 

72 END-PROC 

73 * 

74 REPORT LINESIZE 70 

75 TITLE 'EMPLOYEES IN REGION' -2 SELECT-REGION - 

'BRANCH' -2 SELECT-BRANCH 

76 LINE NAME-FIRST NAME-LAST EMP# 

3/22/84 EMPLOYEES IN REGION 3 BRANCH 02 PAGE 1 

 

FIRST      LAST           EMPLOYEE 

NAME      NAME          NUMBER 

 

JANICE    THOMPSON 01743 

CINDY     SMOTH        01730 

RUTH      ISAAC         12641 

LORRIE   LACH           09609 

LESLIE    GRECO        07231  

WILLIAM REYNOLDS  05805