z/OS DFSORT Application Programming Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Example 8

z/OS DFSORT Application Programming Guide
SC23-6878-00

  SORT FROM(DATA) TO(TEMP) USING(SRTX)
  DISPLAY FROM(TEMP) LIST(WEST) -
    DATE TITLE('Western Region Profit/Loss Report') PAGE -
    BTITLE('Division:') BREAK(3,10,CH) -
    HEADER('Branch Office') ON(16,13,CH) -
    HEADER('Profit/Loss (K)') ON(41,4,PD,/K,E1) -
    BMINIMUM('Lowest Profit/Loss in this Division:') -
    BMAXIMUM('Highest Profit/Loss in this Division:') -
    BAVERAGE('Average Profit/Loss for this Division:') -
    MINIMUM('Lowest Profit/Loss for all Divisions:') -
    MAXIMUM('Highest Profit/Loss for all Divisions:') -
    AVERAGE('Average Profit/Loss for all Divisions:')

This example shows how a report with sections can be produced.

Assume that the SRTXCNTL data set contains:
  SORT FIELDS=(3,10,A,16,13,A),FORMAT=CH

The SORT operator sorts the DATA data set to the TEMP data set using the SORT statement in SRTXCNTL.

The DISPLAY operator uses the sorted records in the TEMP data set to print, in the WEST data set, sections with:
  • A title line containing the date, the specified title string, and the page number
  • A break title containing the specified break title string, and the break field characters from positions 3-12
  • A heading line containing the specified underlined headings
  • Data lines containing:
    • The characters from positions 16-28
    • The packed decimal values from positions 41-44 divided by 1000 and formatted with separators and signs as specified.
  • Break MINIMUM, MAXIMUM, and AVERAGE lines containing the specified strings and statistics for the packed decimal field values in this section, formatted in the same way as the data values.
The last page of the report contains:
  • A title line containing the date, the specified title string, and the page number
  • A heading line containing the specified underlined headings
  • Overall MINIMUM, MAXIMUM, and AVERAGE lines containing the specified strings and statistics for the packed decimal field values in the report, formatted in the same way as the data values.

The first section of the WEST output starts on a new page and looks as follows (several records are shown with illustrative values):

01/14/05        Western Region Profit/Loss Report        - 1 -

Division:  Chips

Branch Office   Profit/Loss (K)
-------------   ---------------
Gilroy                   3,293
Los Angeles               (141)
Morgan Hill                213
Oakland                  1,067
San Francisco              (31)
San Jose                    92
San Martin               1,535

Lowest Profit/Loss in this Division:
                          (141)

Highest Profit/Loss in this Division:
                         3,293

Average Profit/Loss for this Division:
                           861

The title line, break title line, and underlined heading line appear at the top of each page of the section.

The second section of the WEST output starts on a new page and looks as follows (several records are shown with illustrative values):

01/14/05        Western Region Profit/Loss Report        - 2 -

Division:  Ice Cream

Branch Office   Profit/Loss (K)
-------------   ---------------
Marin                      673
Napa                        95
San Francisco             (321)
San Jose                 2,318
San Martin                  21

Lowest Profit/Loss in this Division:
                          (321)

Highest Profit/Loss in this Division:
                         2,318

Average Profit/Loss for this Division:
                           557

The title line, break title line, and underlined heading line appear at the top of each page of the section.

The last page of the WEST output starts on a new page and looks as follows:

01/14/05        Western Region Profit/Loss Report        - 3 -

Branch Office   Profit/Loss (K)
-------------   ---------------

Lowest Profit/Loss for all Divisions:
                          (321)

Highest Profit/Loss for all Divisions:
                         3,293

Average Profit/Loss for all Divisions:
                           734

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014