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


Repeating

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

OUTFIL's REPEAT=n parameter lets you repeat each output record n times. If you specify the BUILD, OUTREC, OVERLAY, or IFTHEN parameters with a sequence number, the sequence numbers are incremented for each repeated record, but otherwise the repeated records are identical. For example, you could use the following statements to create two output data sets with repeated records; one with just the course name and the other with the course name and a sequence number.
  OPTION COPY
  INCLUDE COND=(110,5,CH,EQ,C'PSYCH')
  OUTFIL FNAMES=OUT1,
    REPEAT=3,
    BUILD=(120,25)
  OUTFIL FNAMES=OUT2,
    REPEAT=3,
    BUILD=(120,25,X,SEQNUM,4,ZD)
The results produced for OUT1 are:
PSYCHOLOGY I
PSYCHOLOGY I
PSYCHOLOGY I
PSYCHOANALYSIS
PSYCHOANALYSIS
PSYCHOANALYSIS
The results produced for OUT2 are:
PSYCHOLOGY I              0001
PSYCHOLOGY I              0002
PSYCHOLOGY I              0003
PSYCHOANALYSIS            0004
PSYCHOANALYSIS            0005
PSYCHOANALYSIS            0006
If you specify an IFTHEN clause with a sequence number, the sequence number is only incremented for the subset of records selected by the IFTHEN clause. For example, if you specified the following statements:
  OPTION COPY
  INCLUDE COND=(110,5,CH,EQ,C'PSYCH')
  OUTFIL REPEAT=3,
  IFTHEN=(WHEN=(120,7,CH,EQ,C'PSYCHOL'),
          BUILD=(120,25,X,SEQNUM,4,ZD)),
  IFTHEN=(WHEN=NONE,BUILD=(120,25,X,SEQNUM,2,ZD))
The results produced for SORTOUT are:
PSYCHOLOGY I              0001
PSYCHOLOGY I              0002
PSYCHOLOGY I              0003
PSYCHOANALYSIS            01
PSYCHOANALYSIS            02
PSYCHOANALYSIS            03

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014