Loading

Easytrieve – Report creation sample

In most of the shops, Easytrieve is used for creating reports; and, Easytrieve has more customizable options for reporting.

Detailed reports:
Below is example 1. The output report file must be defined as FB 133 in the JCL.

In the below example, the input file INMAST contains below data

0001
0002
0003
0004
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
 LIST ON
 FILE INMAST FB 4
   IN-NUM 1 4 N
 FILE OUTFILE PRINTER
 JOB INPUT INMAST
    PRINT TEMP-REPT
 END-JOB
*
 REPORT TEMP-REPT PRINTER OUTFILE
 TITLE 1 'ANNUAL REPORT'
 LINE  IN-NUM
*

Output will look like

106/02/12            ANNUAL REPORT         PAGE 1
-                       0001
0                       0002
                        0003
                        0004

Example 2:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
 LIST ON
 FILE INMAST FB 4
   IN-NUM 1 4 N HEADING ('ACCOUNT' 'NUMBER')
 FILE OUTFILE PRINTER
 JOB INPUT INMAST
    PRINT TEMP-REPT
 END-JOB
*
 REPORT TEMP-REPT PRINTER OUTFILE PAGESIZE 50 +
 NOSPREAD NOADJUST NODATE NOPAGE
 TITLE 1 'ANNUAL REPORT'
 LINE  IN-NUM
*

Output will look like

1ANNUAL REPORT
-
 ACCOUNT
 NUMBER
0 0001
  0002
  0003
  0004

Summary reports:
Example 3:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
 LIST ON
 FILE OUTFILE1 PRINTER
*
 WS-VAL1 W 2 A VALUE 'V1'
 WS-VAL2 W 2 A VALUE 'V2'
 WS-VAL3 W 2 A VALUE 'V3'
*
 JOB INPUT NULL
 PRINT SAMPLE1
 STOP
 REPORT SAMPLE1 PRINTER OUTFILE1 PAGESIZE 55 LINESIZE 80 -
 NODATE NOPAGE NOADJUST NOSPREAD NOHEADING
 TITLE 01 COL 01 'HEADING ' -
          COL 30 'VALUES '
 LINE 01 COL 10 'VAL 1 IS ' -
         COL 30 WS-VAL1
 LINE 02 COL 10 'VAL 2 IS ' -
         COL 30 WS-VAL2
 LINE 03 COL 10 'VAL 2 IS ' -
         COL 30 WS-VAL3

Related Posts




blog comments powered by Disqus

There's 26 Comments So Far

Share your thoughts, leave a comment!