Easytrieve Guide for Mainframe Programmers (6 of 20)

VARIOUS I/O COMMANDS:

This section will cover a wide variety of commands that will be essential to the EZT+ programmer in organizing the logic that is necessary to construct an EZT+ program.

The statements to be covered are as follows.

PRINT - which 'prints' an output record to the VFM file by activatingthe designated REPORT ACTIVITY
DISPLAY - directs a 'literal' message and important programmer definedvalues
to a printer, it is somewhat similar to the COBOL command
STOP - terminates an EZT+ JOB activity
PUT -  places a record on a QSAM output file
GET - retrieves a record from an input file once the automatic record 
retrieval feature of EZT+ has been turned off
POINT - 'points' to a record on a KEYED file this is somewhat similar 
to the START command
READ - retrieves a record from a VSAM file
WRITE -  writes a logical record to a designated VSAM file

PRINT STATEMENT

The PRINT Statement is necessary to select a record for output to a report. Activates the report logic defined by the REPORT definition statements. The result of a PRINT statement is data output to either a print file or a work file.

Syntax:

PRINT  report - name
Example:

IF  REG  =  25
PRINT  RPT1
END - IF

Only records with REG  =  25 are output to RPT1.

EZT+

program

print

VFM

printed output

------------->   ----------------->

re-sequencing

--------------------
  • When EZT+ executes a PRINT statement, a detail line is ‘placed’ on the      intermediate VFM file.
  • At EOF, the contents of the VFM are placed in the output queue;  if   ‘re sequencing’ was requested it occurs at this time.
  • ANY data item used in a SEQUENCE, CONTROL or LINE command will be placed in the VFM

DISPLAY STATEMENT

The DISPLAY statement transfers data to the system output device (SYSPRINT).

SYNTAX

DISPLAY       file-name1       NEWPAGE     Literal - 2

SKIP          integer - 1         Field-name - 1

+Integer - 2       HEX

-Integer - 2

COL

POS

file-name1

When file-name1 is specified, EZT+ prints data to the named file.  If this   parameter is omitted, the default is SYSPRINT.

When used, file-name1 MUST be defined in the execution JCL and the   LIBRARY SECTION of your program.

NEWPAGE

A skip to a new page occurs before the data is printed.

SKIP  literal – 1

Specifies that integer-1 number of lines are skipped before the data is printed.

Literal-2/Field-name-1

Code these items in the order you want them to appear on the report line.

Alphanumeric literals must be enclosed with apostrophes.

+Integer-2/-Integer-2

Modifies the horizontal spacing between display items on the report line.

Integer-2 is any item that does not extend beyond the end of the line.

COL  integer – 3

Specifies the print column number where EASYTRIEVE PLUS places the next DISPLAY item.

Integer – 3 is any item that does not extend beyond the end of the line.

POS integer – 4

Within report procedures, this option causes the next DISPLAY data item to be positioned under the corresponding integer – 4 item on the line 01 statement.

HEX

Produces a hexadecimal and character dump of the current record of the file, or the specified field name

DISPLAY HEX cannot be used in report procedures

Examples of display statement:

IF  DEPT   =  911

DISPLAY NEWPAGE POLICY SSN DATE-OF-BIRTH

END - IF

After ejecting to a new page, the values in POLICY, SSN, and DATE-OF-BIRTH would be printed beginning in column 1 which is the default position:

IF  DEPT  =  911

DISPLAY COL 7   '***  ERROR *** '

END - IF
      • 1 – – – – + – – – – 2- – – – + – – – -3 – – – -+ – – – – 4 – – – – +- – – – 5 – – – -+ – – – – 6

***  ERROR ***

The default is overridden by the COL 7 parameter and the display value (***  ERROR ***) starts displaying in column 7

IF  STATE  =  34

DISPLAY SKIP  3  'THE STATE IS'   STATE

END - IF

THE STATE IS 34

After skipping three lines, the information would be displayed as shown above – – column 1 is the DEFAULT.

*      DISPLAY HEX POLNUM

CHAR  2120182

ZONE  FFFFFFF

NUMR 2120182
  1. . . 5 . .

The above display provides the numeric and zoned numeric value that is found in POLNUM.

Related Posts

Discover more from Srinimf

Subscribe now to keep reading and get access to the full archive.

Continue reading