OUTREC control statement

Top  Previous  Next
OUTREC  FIELDS=(
[c:]s |
p,m[,a] |
p |
p,m,HEX |
p,m,f[,edit] |
p,m,f,to )
[, CONVERT | VTOF | FTOLS ]

 

The OUTREC control statement allows you to reformat the input records before they are output. That is, to define which parts of the input record are included in the reformatted output record, in what order they are to appear, and how they are to be aligned.

You do this by defining one or more fields from the input record. The reformatted output record consists of those fields only, in the order in which you have specified them, and aligned on the boundaries or in the columns you have indicated.

Furthermore, it is possible to insert constants, separators and to perform edit and/or conversions on fata fields

Column indicator

The column indicator c: specifies the offset to place the following data field. It must specify a position greater than the sum of the length ofpreviously declared field .

Constants and separators

Constants may be declared as follows:

Declarative

Description

C'string'

specifies a string constant

X'hex string'

specifies an hexadecimal constant

X

specifies a NULL separator (binary 0x00)

Z

specifies a blank separator (space character, binary 0x20)

Each constant may be prefixed by one or more digits, to indicate a multiplier. I.e. "20Z" means 20 spaces, "2C'ABC' produces "ABCABC"

Field declaration

Each input field to be reported on the output record must be identified by its position p, by its length m. Optionally its format f and an eventual edit mask edit may be specified.

Valid edit formats:

ZD
PD
BI
FI

Format mask specifiers:

Identifier  

Description

CR

CR is printed if the value is negative; otherwise, two blanks are printed

S

sign

I

a blank is printed when the digit is an insignificant zero

T

the digit is always printed

Any other character outside the table above is shown at the specified position

Record format conversion

If the CONVERT clause or the VTOF clause is specified, output record is converted from variable length to fixed length record.

If the FTOLS clause is specified, output record is converted into line sequential.