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


Example 4

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

  COPY FROM(INPUT) TO(TEMP) USING(TREG)
  DISPLAY FROM(TEMP) LIST(REGULAR) -
    PAGE TITLE('Report on Regular Tools') TBETWEEN(12)-
    HEADER(NONE) ON(1,18,CH) -
    HEADER(,'Item') ON(35,5,CH) -
    HEADER('Percent','Change') ON(28,4,FS,B1) -
    LINES(66)
  COPY FROM(INPUT) TO(TEMP) USING(TPOW)
  DISPLAY FROM(TEMP) LIST(POWER) -
    PAGE TITLE('Report on Power Tools ') TBETWEEN(12)-
    HEADER(NONE) ON(1,18,CH) -
    HEADER(,'Item') ON(35,5,CH) -
    HEADER('Percent','Change') ON(28,4,FS,B1) -
    LINES(66)
This example shows how reports for different subsets of data can be produced. Assume that:
  • The TREGCNTL data set contains:
      INCLUDE COND=(44,8,CH,EQ,C'Regular')
  • The TPOWCNTL data set contains:
      INCLUDE COND=(44,8,CH,EQ,C'Power')

The first COPY operator copies the records from the INPUT data set that contain 'Regular ' in positions 44-51 to the TEMP (temporary) data set

The first DISPLAY operator uses the first subset of records in the TEMP data set to print, in the REGULAR data set:
  • A title line containing the page number and specified title, with twelve blanks between these report elements.
  • A two-line heading containing the specified underlined strings (with no heading for the first ON field)). Note the comma in HEADER(,'Item') to place 'Item' on line2 of the heading.
  • Data lines for the first subset of records containing:
    • The characters from positions 1-18
    • The characters from positions 35-39
    • The floating sign values from positions 28-31 formatted with one decimal place and a period as the decimal point

The second COPY operator copies the records from the INPUT data set that contain 'Power ' in positions 44-51 to the TEMP (temporary) data set

The second DISPLAY operator uses the second subset of records in the TEMP data set to print, in the POWER data set:
  • A title line containing the page number and specified title, with twelve blanks between these report elements.
  • A two-line heading containing the specified underlined strings (with no heading for the first ON field)). Note the comma in HEADER(,'Item') to place 'Item' on line2 of the heading.
  • Data lines for the second subset of records containing:
    • The characters from positions 1-18
    • The characters from positions 35-39
    • The floating sign values from positions 28-31 formatted with one decimal place and a period as the decimal point

The REGULAR output starts on a new page and looks as follows (the first 2 records are shown with illustrative values):

- 1 -            Report on Regular Tools

                             Percent
                     Item     Change
                     -----   -------
Hammers              10325      -7.3
Wrenches             00273      15.8

The title line and underlined heading lines appear at the top of each page. The number of lines per page is 66, overriding the default of 58.

The POWER output starts on a new page and looks as follows (the first 2 records are shown with illustrative values):

- 1 -            Report on Power Tools

                             Percent
                     Item     Change
                     -----   -------
Hammers              10325       9.8
Wrenches             00273     123.0

The title line and underlined heading lines appear at the top of each page. The number of lines per page is 66, overriding the default of 58.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014