z/OS DFSORT: Getting Started
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Printing tailored reports

z/OS DFSORT: Getting Started
SC23-6880-00

The previous tutorial showed you how to print a simple listing of numeric and character fields using the DISPLAY operator. By using additional operands of DISPLAY, you can create list data sets showing character and numeric fields in a variety of tailored report formats. You can specify:
  • title strings in up to three title lines (TITLE operands), other title elements for the first title line ( DATE, PAGE, and TIME operands) spacing between title elements (TBETWEEN operand), left alignment of title strings instead of center alignment (TLEFT operand) and title lines only on the first page instead of on every page (TFIRST operand)
  • one, two or three line field headings (HEADER operand)
  • spacing for columns (INDENT, BETWEEN, and STATLEFT operands)
  • field formatting (BLANK and PLUS operands), and formatting items for individual ON fields
  • statistics (TOTAL, AVERAGE, MAXIMUM, MINIMUM, and COUNT operands)
  • lines per page (LINES operand)
  • suppression of ANSI carriage control characters (NOCC operand)

Refer to z/OS DFSORT Application Programming Guide for complete details on these and other operands you can use with DISPLAY.

To print a report for the Colorado branches showing the city, profit and employee fields with a title line, field headings, totals, averages, minimums, and counts, write the following DISPLAY operator:

Printing a report for the Colorado branches showing the city, profit and employee fields with a title line, field headings, totals, averages, minimums, and counts

CODASD is the ddname for the previously created Colorado branches data set. RPT is the ddname for the list data set in which you want the report to be printed.

DATE, TITLE and PAGE indicate the elements to be included in the title line and their placement. Specify these operands in the same order in which you want them to be printed in the list data set.

Each HEADER indicates a heading to be used for the corresponding field. Specify the ON fields and their corresponding HEADER strings in the same order in which you want their values to be printed in the list data set.

BLANK specifies that numeric values are printed with blank for plus sign, - for minus sign and no leading zeros. BETWEEN specifies the number of spaces between columns (overriding the default of 3). HEADER, BLANK and BETWEEN change the justification and column width for the fields, and the spacing between them, to produce a more report-like format.

TOTAL, AVERAGE, MINIMUM, and COUNT cause the indicated statistics to be produced at the end of the report, identified by the specified strings.

Because RPT has not been defined previously, you must add a JCL statement for it at the end of the job:

//RPT DD SYSOUT=A

When this DISPLAY operator is run, the RPT data set that results looks like:

07/22/08        Colorado Branches Report        - 1 -

City                          Profit            Employees
---------------     ----------------     ----------------
Aspen                           5200                   20
Boulder                         7351                   32
Denver                          6288                   33
Fort Collins                   -2863                   22
Vail                            5027                   19

Total                          21003                  126

Average                         4200                   25

Lowest                         -2863                   19

Number of cities              5

The title line and heading line are printed at the top of each page. The character data is left-justified and the numeric data is right-justified with zeros suppressed. The statistics are printed after the columns of data.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014