DFSORT OUTREC Inserting data

DFSORT Reformatting with fixed fields DFSORT OUTREC: Data Translation

Advertisements


OUTREC can be used to insert the below data types between the fields in the output file.

  • Binary Zeroes
  • Blanks
  • Strings

Inserting binary zeros


Insert binary zeros as place holders for the new field.

The new field may get to be filled inwith data at a later date.

Z or 1Z used to specify a single binary zero.

nZ used to specify n binary zeros.


Syntax:

OUTREC FIELDS=(starting position of field1, length of field1,
		starting position of new field, new field length, nZ….. )

Let’s discuss in detail.

nameDescription
Starting position of field1Specifies field1starting position in the input file after sorting.
Length of feild1 Field1 physical length in input file.
Starting position of new fieldStarting position of new field which needs to filled with zeroes
New field lengthNumber of positions that needs to filled with zeroes
nZn is number of zeroes.
n can be from 1 to 4095.
If n ignored, n can be treated as 1

Note: n and new field length should always match for the accurate results.

Example: - Will update soon

Inserting blanks


OUTREC statement used toseparate the fields with blanks and to create margins.

A blank can insert before,between, or after fields.

X or 1X used to specify a single blank.

nX used to specify n blanks.


Syntax:

OUTREC FIELDS=(starting position of field1, length of field1,nX….. )

Let’s discuss in detail.

nameDescription
Starting position of field1Specifies field1starting position in the input file after sorting.
Length of feild1 Field1 physical length in input file.
nXn is number of spaces.
n can be from 1 to 4095.
If n ignored, n can be treated as 1
Example: - Will update soon

Inserting strings


OUTREC can be used to setup a very basic report format by inserting strings.

Normally the OUTFIL control statement can be used to create complex reports.


Character strings

The format for writing a character string is:C’x...x’ where x is an EBCDIC character.


Syntax-1 : Character strings

OUTREC FIELDS=(starting position of field1, length of field1,C’xx..xx’,….. )

Syntax-2 :Repeating character strings

OUTREC FIELDS=(starting position of field1, length of field1,n:C’xx..xx’,….. )

Hexadecimal strings

The format for writing a hexadecimal string is: X’yy...yy’where yyis a pair of hexadecimal digits.


Syntax-3 :Hexa Deciamal strings

OUTREC FIELDS=(starting position of field1, length of field1,X’yy..yy’,….. )

Let’s discuss in detail.

nameDescription
Starting position of field1Specifies field1starting position in the input file after sorting.
Length of feild1 Field1 physical length in input file.
C’xx..xx’Character string that needs to be insert.
OUTREC will insert the string for the specific length
n:C’xx..xx’ n is the number of times character string repeats
X’yy..yy’ Hexa decimal string
Example: - Will update soon


DFSORT Reformatting with fixed fields DFSORT OUTREC: Data Translation

Advertisements