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

book

Article ID: 50926

calendar_today

Updated On:

Products

CA PanAudit Plus CA Easytrieve Report Generator CA PAN/SQL CA Endevor Software Change Manager (SCM) CA Endevor Software Change Manager - Natural Integration (SCM) CA Endevor Software Change Manager - ECLIPSE Plugin (SCM) CA Endevor Software Change Manager - Enterprise Workbench (SCM)

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: