How to create reports with DFSORT the best way

You can use DFSORT for creating an excellent report. The headers are HEADER1, HEADER2, and HEADER3. Also, you can give trailers TRAILER1, TRAILER2 parameters, and TRAILER3.


Let you specify multi-line headings with character strings, hexadecimal strings, input fields, the current date, the current time, page numbers and blank lines.

In addition, you can include edited or converted record counts, and edited or converted totals, maximums, minimums, and averages for numeric fields, in your trailers.

//SYSIN DD *
SORT FIELDS=(1,15,CH,A)
OUTFIL FNAMES=RPT4,
HEADER2=(1:'BRANCH',18:'REVENUE',28:'PROFIT'),
OUTREC=(1,15,X,
22,6,PD,EDIT=(SIII,IIT),SIGNS=(,-),X,
28,6,PD,EDIT=(SIII,IIT),SIGNS=(,-),
50:X),
TRAILER1=(2/,
3:'Overall results for branches on ',DATE=(MD4/),':',2/,
3:COUNT=(EDIT=(IIT)),' branches are included',2/,
5:'Total revenue = ',
TOT=(22,6,PD,M12,LENGTH=10),/,
5:'Average revenue = ',
AVG=(22,6,PD,M12,LENGTH=10),/,
5:'Lowest revenue = ',
MIN=(22,6,PD,M12,LENGTH=10),/,
5:'Highest revenue = ',
MAX=(22,6,PD,M12,LENGTH=10))

Related Posts

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.