DFSORT INREC Inserting sequence numbers

DFSORT INREC DFSORT OUTFIL

Advertisements


To getback the original order of data before sort, a sequence number can be added to each record before therecords are sorted, and use a second step to sort the records back into theiroriginal order by that sequence number.

INREC statement can be used toadd the sequence number.


Syntax:
INREC FIELDS=(…,SEQNUM, length, format,..)

Name Description
SEQNUMA keyword specifies the sequence number to be generated from the next available position of INREC
Length Length of the sequence number to be generated
FormatFormat of the sequence number to be generated

Note: SUM can’t combine withCOPY


Example: - Will update soon


DFSORT INREC DFSORT OUTFIL

Advertisements