DDS for physical and logical files

Specifying COMP at the field level

At the field level, COMP 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 now describing by specifying R in position 29 and the REF or REFFLD keyword. During display file creation, the OS/400 program 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. See the Reference for display files topic for details.

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 for a display file. See the COMP keyword for display files for more information and an example that shows how to specify the keyword.

Defining a numeric field for physical and logical files:

When a work station user types in data, the OS/400 program 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 OS/400 program 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.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]