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


Data

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

The data for your report consists of the OUTFIL output records. You can use the INCLUDE, OMIT, INREC, SUM and OUTREC statements, and the OUTFIL parameters STARTREC, SAMPLE, ENDREC, INCLUDE, OMIT, ACCEPT, SAVE, PARSE, BUILD, OUTREC, OVERLAY, FINDREP, and IFTHEN to determine which data records appear in your report and what they look like.

The following statements show the simplest possible type of OUTFIL report you can produce:
  OPTION COPY
  OUTFIL FNAMES=RPT1,LINES=10

LINES=10 indicates you want a report with 10 lines per page. These statements might produce the following two page result for RPT1:

1Data line 01
 Data line 02
 Data line 03
 Data line 04
 Data line 05
 Data line 06
 Data line 07
 Data line 08
 Data line 09
 Data line 10
1Data line 11
 Data line 12
 Data line 13
 Data line 14
 Data line 15
Note: In some of the examples later in this section, small LINES values are used to illustrate a point. However, the default for LINES is 60 and you would generally want to use either that value or one close to it.

For reports, OUTFIL places an ANSI carriage control character in the first byte of each output line to tell a printer what action to take for that line. The '1' for Data line 01 and Data line 11 tells the printer that these lines each start on a new page. This is the way DFSORT translates LINES=10 into 10 lines per page for the printer. Other ANSI carriage control characters that DFSORT uses for OUTFIL reports are: blank for single space (no blank lines before the output line), '0' for double space (one blank line before the output line), and '-' for triple space (two blank lines before the output line).

When you view a report on your display, the ANSI carriage control is not meaningful, and is usually not displayed even though it's actually in the record. If you don't want ANSI carriage control characters in your output records, you can use OUTFIL's REMOVECC parameter to remove them (more on this later).

In general, you will want to use the PARSE, BUILD, OUTREC, OVERLAY, FINDREP, or IFTHEN parameters to reformat the data records for your report. Suppose you want to print a report from the SORT.BRANCH data set showing each branch's revenue and profit or loss, with 9 lines per page. You can use the following statements to show the branches in sorted order, along with their revenue and profit fields in readable form:
  SORT FIELDS=(1,15,CH,A)
  OUTFIL FNAMES=RPT2,LINES=9,
    OUTREC=(1,15,X,
          22,6,PD,EDIT=(SIII,IIT),SIGNS=(,-),X,
          28,6,PD,EDIT=(SIII,IIT),SIGNS=(,-))
The two page result produced for RPT2 is the following:
1Aspen             25,800    5,200
 Boulder           33,866    7,351
 Denver            31,876    6,288
 Fort Collins      12,300   -2,863
 Los Angeles       22,530   -4,278
 Morgan Hill       18,200    3,271
 Sacramento        42,726    8,276
 San Diego         32,940    8,275
 San Francisco     42,820    6,832
1San Jose          27,225    8,264
 Sunnyvale         16,152     -978
 Vail              23,202    5,027

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014