Tuesday, December 30, 2008

SUBSET

SUBSET is a new ICETOOL operator that allows you to create a subset of the input or output records with specific header, trailer, and relative records, or without specific header, trailer, and relative records. SUBSET gives you new capabilities for keeping or removing the first n records of your data set, the last n records of your data set, and/or specific relative records in your data set. SUBSET does not require an "identifier" in the records to be keptor removed; it keeps track of the first n records, relative record numbers, and the last n records automatically.

Various options of SUBSET allow you to define the criteria for keeping or removing records.

As an example, you could use the following SUBSET operator to keep the first two input records, the fifth, sixth and seventh input records, and the last input record.

SUBSET FROM(IN) TO(OUT) KEEP INPUT FIRST(2) RRN(5,7) LAST
I/P records:
HEADER 001
HEADER 002
Vicky
Frank
Regina
Viet
David
Dave
Carrie
Sam
Sri Hari
Martin
LAST 999

O/P records:
HEADER 001
HEADER 002
Regina
Viet
David
LAST 999

Syntax - The syntax for the SUBSET operator is as follows:
SUBSET FROM(indd) TO(outdd) DISCARD(savedd) KEEPREMOVE INPUTOUTPUT HEADERFIRSTHEADER(x)FIRST(x)
RRN(x)RRN(x,y)RRN(x,*) ...
TRAILERLASTTRAILER(x)LAST(x)
USING(xxxx) VSAMTYPE(x)

Detailed Description :
  • FROM(indd) - Specifies the ddname of the input data set.
  • TO(outdd) - Specifies the ddname of the output data set , TO and DISCARD can both be specified.
  • DISCARD(savedd) - DFSORT will write the records it does not select for the operation.
  • KEEP - Specifies that the records that meet the criteria are to be kept.
  • REMOVE - Specifies that the records that meet the criteria are to be removed.
  • INPUT - The criteria of records selection takes place before INREC or SORT.
  • OUTPUT - The criteria of records selection takes place after INREC or SORT.
  • RRN(x) - point to exact single records,
  • RRN(x,y) - specifies a range of records,
  • RRN(x,*) - Specifies relative record numbers x through the last record.

Hope you find it useful. Please do provide your comments or reactions. For further reference click here.

No comments:

Post a Comment