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


Keeping or removing headers, trailers and relative records

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

You can use ICETOOL's SUBSET operator to create a subset of the input or output records with or without specific header, trailer or relative records. You use the following operands to tell SUBSET which records you want to keep or remove:

  • KEEP - keep the specified records
  • REMOVE - remove the specified records
  • INPUT - keep or remove input records
  • OUTPUT - keep or remove output records
  • HEADER or FIRST - keep or remove the first record (header record)
  • HEADER(x) or FIRST(x) - keep or remove the first x records (header records)
  • RRN(u) - keep or remove relative record u
  • RRN(u,v) - keep or remove relative records u through v
  • RRN(u,*) - keep or remove relative records u through the last record
  • TRAILER or LAST - keep or remove the last record (trailer record)
  • TRAILER(y) or LAST(y) - keep or remove the last y records (trailer records)

The records that are selected (that is, kept or not removed) are written to the output data set identified by the TO operand. If appropriate, you can use the DISCARD operand to save the records that are not selected to a separate output data set identified by the DISCARD operand. You can create just the TO data set, just the DISCARD data set, or both.

You can use a USING data set to specify various DFSORT statements with SUBSET; see z/OS DFSORT Application Programming Guide for details.

Suppose you have input records that look like this:
MASTER03.IN          
2008/04/23           
Vicky                
Frank                
Regina               
Viet                 
David                
Dave                 
Carrie               
Sam                  
Sri Hari             
Martin               
UPDATE03.OUT   
You want to create an output data set with the the first two input records, the fifth through seventh input records, the eleventh input record, and the last input record. Write the following ICETOOL statement:
SUBSET FROM(INPUT) TO(OUTPUT) KEEP INPUT-
  FIRST(2) RRN(5,7) RRN(11) LAST    
The output records would look like this:
MASTER03.IN        
2008/04/23         
Regina             
Viet               
David   
Sri Hari           
UPDATE03.OUT       

For complete details of SUBSET, as well as more examples, see z/OS DFSORT Application Programming Guide.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014