How to re-read the same file in one job activity?
search cancel

How to re-read the same file in one job activity?

book

Article ID: 50926

calendar_today

Updated On:

Products

PanAudit Plus Easytrieve Report Generator PAN/SQL Endevor Endevor Natural Integration Endevor - ECLIPSE Plugin Endevor - Enterprise Workbench

Issue/Introduction

Description:

How can an Easytrieve program be coded to process the same file multiple times within one job activity?

Note you have to code your own file processing loop and not rely on Easytrieve since you want to read the same file more than once.

The following solution is coded for EZT 11.x and makes use of the new CLOSE statement. It will not work for prior releases or compatibility mode.

Solution:

FILE PERSNL F(150)
 %PERSNL
 JOB INPUT NULL
   * First time through
   DO UNTIL EOF PERSNL
     GET PERSNL
     IF REGION EQ 1
       PRINT REPORT1
     END-IF
   END-DO
   CLOSE PERSNL
 
   * Second time through
   DO UNTIL EOF PERSNL
     GET PERSNL
     IF REGION EQ 2
       PRINT REPORT2
     END-IF
   END-DO
   STOP
 
 REPORT REPORT1
   LINE NAME-LAST EMP#
 
 REPORT REPORT2
   LINE NAME-LAST ADDR-ZIP

Environment

Release: EDBMSU00200-11.5-Easytrieve-Report Generator-Option for DB2-MSU
Component: