Best DFSORT INREC and OUTREC Example

INREC and OUTREC are the two important parameters we used in Sort.

INREC ==> Reformatted input record. We do not take the complete record. We only take part in the record.

OUTREC=>Reformatted output record.This contains what are the input fields(in the sorted input) will have in the output file.

General Syntax:

INREC  FIELDS=([c:][separation-fld,]position,length…)
OUTREC FIELDS=([c:][separation-fld,]position,length)

c: Specifies the column (byte) in which a data field or separation field should be placed, relative to the start of the record. If the column settings that are coded skip over any bytes, those bytes are filled with spaces.

Separation field: Tells the sort/merge utility to insert a constant value into the record. The constant can be specified in one of these forms:

Nx: Inserts n repetitions of spaces

Nz: Inserts n repetitions of binary zeros

Nc’text’: Inserts n repetitions of the specified text

NX’hex’: Inserts n repetitions of the specified hex value

If n is omitted, one repetition of the specified constant is inserted.

IBM example-Check here.

Related Posts

Author: Srini

Experienced software developer. Skills in Development, Coding, Testing and Debugging. Good Data analytic skills (Data Warehousing and BI). Also skills in Mainframe.

One thought

Comments are closed.