Use Report Workfiles to resolve A004 Catastrophic Error
search cancel

Use Report Workfiles to resolve A004 Catastrophic Error

book

Article ID: 217099

calendar_today

Updated On:

Products

Easytrieve Report Generator

Issue/Introduction

When receiving an A004 Catastrophic Error, one reason is because the EZTVFM file is filled and cannot span work packs.
Therefore, the resolution is to use Report Workfiles.  Please see the steps below on using Report Workfiles.

Environment

CA Easytrieve Report Generator, release 11.6

Resolution

HOW TO USE A REPORT WORKFILE:

   1. ADD A DD STATEMENT TO YOUR JCL:  
        //RPTWRK1 DD UNIT=SYSDA,SPACE=(CYL,1)    *or whatever space you need 
        //RPTWRK2 DD UNIT=SYSDA,SPACE=(CYL,1)    *or whatever space you need 
        and so on depending on the number of reports your program generates.

  1. ADD TO YOUR LIBRARY SECTION:
     FILE  RPTWRK1  F(60) – OR – FILE  RPTWRK1  FB(60 600) 
     FILE  RPTWRK2  F(42) – OR – FILE  RPTWRK1  FB(42 420)

    In order to determine the record length for your workfile, first run the program without the workfile.

Please add these statements to your program making the number of records great enough to write out at least one record to each report:
               IF RECORD-COUNT GT 1000
                 STOP
               END-IF

After the run, look at the file statistics for EZTR00# report workfiles.  REPORT 1 gets spooled to EZTR001, REPORT 2 gets spooled to EZTR002, etc.  For each file, you should see the VFM record length (LRECL).  This is the length you should specify for each of your RPTWORK files.  In this example, the EZTR001 file had an lrecl of 60, so this is what was specified for RPTWRK1.  EZTR002 had an lrecl of 42, therefore RPTWRK2 has an lrecl of 42. The only other way to get the LRECL for the report workfile is to add up the lengths of ALL fields (file fields, ‘w’ type working storage fields) used in the REPORT section.

      3. Add to your REPORT statement:
           REPORT RPT1...FILE RPTWRK1... 
           REPORT RPT2…FILE RPTWRK2…

USING REPORT WORKFILES MEANS THAT AS THE INFORMATION NEEDED FOR EACH REPORT IS SPOOLED OUT TO THE INDIVIDUAL WORKFILES YOU ALLOCATED, INSTEAD OF GOING TO EZTVFM.  THESE WORKFILES MAY SPAN PACKS WHILE OUR EZTVFM FILE CANNOT SPAN PACKS.

Additional Information

  1. If the program only creates one report and it does NOT have a SEQUENCE statement, CA Easytrieve does real time printing of the report and are NOT spooling data to the EZTVFM.
  2. If the program creates two or more reports and none of the reports have  a SEQUENCE statement, CA Easytrieve will do real time printing of the first report and any subsequent reports will spool to EZTVFM. 
  3. If the first report has a SEQUENCE statement, all will spool to EZTVFM.   
  4. PRINTER files are NOT the same thing as report workfiles.