Specifying COMP at the field level

At the field level, the COMP keyword does not affect the physical or logical file you are describing.

However, when you describe an input-capable field in a display file, you can refer to the field you are describing by specifying R in position 29 and the REF or REFFLD keyword. During display file creation, the operating system copies the COMP keyword and other field attributes from the field in the logical file into the field in the display file. You can override the COMP keyword (as well as all other validity checking keywords and the CHKMSGID keyword) by specifying any validity checking keyword for the field in the display file.

You cannot specify a field name as a parameter value for a field-level COMP keyword.

You cannot specify *NULL as a parameter value for a field level COMP keyword.

You cannot specify the COMP keyword on a floating-point field (F in position 35) or a hexadecimal field (H in position 35). Do not specify the COMP keyword on a date, time, or timestamp field (L, T, or Z in position 35).

The rules for specifying this keyword in a physical or logical file are the same as the rules for a display file.

Defining a numeric field for physical and logical files

When a workstation user types in data, the operating system aligns the characters typed in according to the number of decimal positions in the field. Leading and trailing blanks are filled with zeros when the field is passed to your program. If you do not type a decimal character, the operating system places a decimal character to the right of the farthest right character typed. For example, for a numeric field with a length of 5 (specified in position 34) and 2 decimal positions (specified in position 37), 1.2 is interpreted as 001.20, and 100 is interpreted as 100.00.