A report contains three sections of HEADER DETAILS, DATA DETAILS, and TRAILER DETAILS. Let’s look at how to create a formatted report using SYNCSORT.
Headers are used to provide a report, page, and section headings such as titles, page numbers, the current date, labels for each column of data, and the like.
HEADER1 and HEADER2 are parameters of the OUTFIL control statement. HEADER3 is a subparameter of OUTFIL’s SECTIONS parameter.
HEADER1=(2/,20:'EMPLOYEE INFORMATION', 2/,1:'FIRSTNAME',14:'LASTNAME',29:'WORKDEPT', 41:'HIRE DATE',54:'LEVEL',65:'SALARY', /, 1:'-------',14:'—------',29:'-------', 40:'-----', 54:'------',65:'---------') OUTPUT EMPLOYEE INFOMATION FIRSTNAME LASTNAME WORK DEPT HIRE DATE LEVEL SALARY --------- -------- --------- --------- ----- ------
HEADER2=(1:'ABCD’, 46:'DEPARTMENT SALES REPORT' 101:'DATE:', 107:&DATE, Generates Page Heading 121:'PAGE:', 127:&PAGE,//, 1:'DEPARTMENT', 40:'SALES MANAGER', 61:'SALES REP', 78:'SALES', 103:'SALES YEAR TO DATE',//), OUTPUT ABCD DEPARTMENT SALES REPORT DATE: 02/01/18 PAGE: 1 DEPARTMENT SALES MANAGER SALES REP SALES SALES YEAR TO DATE
SECTIONS=(1,15,SKIP=5L, Generates Section Breaks HEADER3=(1:'DEPARTMENT', Generates Section Headings 23:'SALES MGR', 48:'SALES REP', 68:'SALES', 97:'SALES YEAR TO DATE',//)) OUTPUT DEPARTMENT SALES MGR SALES REP SALES SALES YEAR TO DATE CCS CASEY 075 $14,000.00 $27,000.00 CCS CASEY 175 $18,000.00 $37,000.00 ------------ ------------ DEPARTMENT SALES MGR SALES REP SALES SALES YEAR TO DATE SURGICAL KILDARE 003 $11,750.00 $25,320.00 SURGICAL KILDARE 007 $14,300.00 $24,900.00 SURGICAL KILDARE 009 $14,500.00 $24,200.00 ------------ ------------
Data is extracted from the input using multiple conditions.
EXAMPLE SORT FIELDS=(1,15,CH,A) Sorts Records OUTFIL OUTREC=(1:1,15, Repositions Fields on Output 23:23,7, Records and Edits Data 51:48,3, 72:60,4,PD,EDIT=($II,IIT.TT), 101:64,4,PD,EDIT=($II,IIT.TT), 114:C' ') OUTPUT SURGICAL KILDARE 003 $11,750.00 $25,320.00 SURGICAL KILDARE 007 $14,300.00 24,900.00 SURGICAL KILDARE 009 11,110.00 30,850.00 ----------- -----------
trailers are used for report, page, and section summaries. You can use them, for example, to provide totals for columns of numeric data (“ Totaling and Subtotaling Data”) or to indicate the end of a section with, say, a string of asterisks or to provide a list of abbreviations used in the report.
TRAILER1 and TRAILER2 are parameters of the OUTFIL control statement; TRAILER3 is a subparameter of OUTFIL’s SECTIONS parameter.
TRAILER1, TRAILER2, and TRAILER3 also provide TOTAL, SUBTOTAL, MIN, SUBMIN, MAX, SUBMAX, AVG, SUBAVG, COUNT, SUBCOUNT, COUNT15, and SUBCOUNT15 capabilities at the report, page, and section levels.
TRAILER1=(20/, Generates Report Trailer with Totals 40:'SALES THIS PERIOD:', 59:TOT=(24,4,PD,EDIT=($II,IIT.TT)), 73:'SALES TO DATE:', 88:TOT=(28,4,PD,EDIT=($II,IIT.TT))) OUTPUT: SALES THIS PERIOD: $35,807.85 SALES TO DATE: $62,305.25
TRAILER2=(65:10'-', 86:10'-',/, 40:'TOTALS:', 65:SUB=(46,4,PD,EDIT=($II,IIT.TT)), 86:SUB=(54,4,PD,EDIT=($II,IIT.TT))) OUTPUT TOTALS: $6,150.00 $66,475.00
SECTIONS=(32,4,SKIP=3L, TRAILER3=(65:10'-',86:10'-',/, 40:'TOTALS:', 65:TOT=(46,4,PD,EDIT=($II,IIT.TT)), 86:TOT=(54,4,PD,EDIT=($II,IIT.TT)))) OUTPUT ------------- ------------- TOTALS: $2,600.00 $19,770.00 ------------- ------------- TOTALS: $3,600.00 $29,730.00 ------------- ------------- TOTALS: $7,340.00 $39,170.00 TOTAL, MIN, MAX, AVG & SUBAVG Function use in SORT: TRAILER3=(6:'=============',24:'====================',/, 6:'Total',24:TOTAL=(31,10,ZD,M5,LENGTH=20),/, 6:'Lowest',24:MIN=(31,10,ZD,M5,LENGTH=20),/, 6:'Highest',24:MAX=(31,10,ZD,M5,LENGTH=20),/, 6:'Average',24:AVG=(31,10,ZD,M5,LENGTH=20),/, 3/,2:'Average for all Branch Offices so far:', X,SUBAVG=(31,10,ZD,M5))),
INPUT Joseph Smith 02506240 James Jones 12345678 John Jackson 00987654 Mary Lee 07677201 Michael Jay 04216797 SYSIN STATEMENT SORT FIELDS=(21,7,ZD,D) -->sort from highest to lowest sales OUTFIL OUTREC=(1,20,24:C’$’,21,8,ZD,M2,LENGTH=13),--> printed report HEADER2=(‘September Sales Report ‘,&DATE,3/, ‘Salesperson Name’,24:’ Sales’,/), TRAILER2=(‘Total Sales:’,24:’$’,TOT=(21,8,ZD,M2,LENGTH=13)) OUTFIL OUTREC=(1,20,24:C’$’,21,8,ZD,M2,LENGTH=13), PDF report HEADER2=(‘September Sales Report ‘,&DATE,3/, ‘Salesperson Name’,24:’ Sales’,/), TRAILER2=(‘Total Sales:’,24:’$’,TOT=(21,8,ZD,M2,LENGTH=13)) OUTPUT September Sales Report Salesperson Name Sales James Jones $123,456.78 Mary Lee $ 76,772.01 Michael Jay $ 42,167.97 Joseph Smith $ 25,062.40 John Jackson $ 9,876.54 Total Sales: $277,335.70
A well-maintained product backlog is crucial for successful product development. It serves as a single…
Incremental value to the customer refers to the gradual delivery of small, functional parts of…
A Product Market refers to the group of potential customers who might be interested in…
The Professional Agile Leadership - Evidence-Based Management (PAL-EBM) certification offered by Scrum.org is designed for…
The Professional Agile Leadership (PAL I) certification, offered by Scrum.org, is designed to equip leaders…
Choosing the right Scrum Master Certification depends on your current experience and career goals. If…