JCL

Header Trailer using SYNCSORT – JCL

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.

HEADER DETAILS

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, the report header provides a header or a possible title page for the entire report. It appears only once at the beginning of the report on its own page.
  • HEADER2, the page header provides a page header or a running head for each page defined by the LINES parameter. It appears at the beginning or top of each page.
  • HEADER3, the section header provides a section header that appears at the beginning of each specified section and, optionally, at the top of each page (or directly below any HEADER2).

HEADER1 and HEADER2 are parameters of the OUTFIL control statement. HEADER3 is a subparameter of OUTFIL’s SECTIONS parameter.

HEADER & TRAILER Examples

HEADER1 Example

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 Example

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

HEADER3 Example

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 DETAILS

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
-----------
-----------

TRAILER DETAILS

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 provides a trailer or a possible summary for the entire report. It appears only once at the end of the report on its own page.
  • TRAILER2 provides a page trailer for each page defined by the LINES parameter. It appears at the end of each page.
  • TRAILER3 provides a section trailer that appears at the end of each specified section and serves as a conclusion or summary for that section.

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.

EXAMPLE OF TRAILER1

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

EXAMPLE OF TRAILER2

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

EXAMPLE OF TRAILER3

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))), 

Example using HEADER DATA and TRAILER

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

IFTHEN with SYNCSOT – Click Here    SyncSort Manual: Click Here

Admin

Share
Published by
Admin

Recent Posts

Increase Transparency and Collaboration Product Backlog

A well-maintained product backlog is crucial for successful product development. It serves as a single…

4 days ago

Product Backlog – Incremental value to the customer

Incremental value to the customer refers to the gradual delivery of small, functional parts of…

6 days ago

Product Market, Customer’s Desire, Need, and Challenges

A Product Market refers to the group of potential customers who might be interested in…

1 week ago

PAL-EBM Professional Agile Leadership – EBM Certification

The Professional Agile Leadership - Evidence-Based Management (PAL-EBM) certification offered by Scrum.org is designed for…

3 months ago

PAL I Professional Agile Leadership Certification

The Professional Agile Leadership (PAL I) certification, offered by Scrum.org, is designed to equip leaders…

4 months ago

Scrum Master Certification: CSM, PSM, SSM

Choosing the right Scrum Master Certification depends on your current experience and career goals. If…

5 months ago