DFSORT OUTREC Inserting sequence numbers

OUTREC: Reformatting with IFTHEN DFSORT INREC

Advertisements


OUTREC statement can be used toadd the sequence number to the records after sorting.


Syntax- Simple sequence number generation:
OUTREC OVERLAY=(…,Starting position in o/p file:SEQNUM, length, format,..)

Name Description
Starting position in o/p fileSpecifies the position from where the sequence number to start in o/p file
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

Syntax- sequence number generation with increment:
OUTREC OVERLAY=(…,Starting position in o/p file:SEQNUM, length, 
		format,START=start number, INCR=increment by, Restart=(field1 starting position, field1 length)…)

Name Description
Starting position in o/p fileSpecifies the position from where the sequence number to start in o/p file
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
START=start numberSpecifies the sequence number starts with
INCR=increment bySpecifies the number that used to increment the start number
Restart=(field1 starting position, field1 length)Specifies the field starting position and length on which the sequence number restart

Example: - Will update soon


OUTREC: Reformatting with IFTHEN DFSORT INREC

Advertisements