DDS Data Type for physical and logical files (Position 35)

For a physical file, use this position to specify the data type of the field within the database.

Specify data type in a logical file only to override or change the data type of the corresponding field in the physical file on which this logical file is based. If you leave this position blank, the field you are defining has the same data type as the corresponding field in the physical file(s) on which the logical file(s) is based.

Valid data type entries are as follows:

Entry
Meaning

P
Packed decimal

S
Zoned decimal

B
Binary

F
Floating-point

A
Character

H
Hexadecimal

L
Date

T
Time

Z
Timestamp

Figure 10 and Figure 8 show how to code the data type.

For physical files, if you do not specify a data type or duplicate one from a referenced field, the OS/400 program assigns the following defaults:

Notes:

  1. Specify 0 in position 37 to indicate an integer numeric field for packed decimal, zoned decimal, or binary fields.

  2. Specify an F in position 35 for a single precision floating-point field. Use the FLTPCN keyword to specify double precision or to change the precision of an already specified floating-point field.

  3. Specify an H (hexadecimal) in position 35 to indicate a field whose contents are not interpreted by the system. In most cases, hexadecimal fields are treated as character fields, except the contents of a hexadecimal field are not translated to any character set or code page.

The following table shows what types of data conversion are valid between physical and logical files:
Physical File Data Type Logical File Data Type
Character Hexa- decimal Zoned Packed Binary Floating Point Date Time Time- stamp
Character Valid Valid See Note 1 Not valid Not valid Not valid Not valid Not valid Not valid
Hexa- decimal Valid Valid See Note 1 Not valid Not valid Not valid Not valid Not valid Not valid
Zoned See Note 1 See Note 1 Valid Valid See Note 2 Valid Not valid Not valid Not valid
Packed Not valid Not valid Valid Valid See Note 2 Valid Not valid Not valid Not valid
Binary Not valid Not valid See Note 2 See Note 2 See Note 3 See Note 2 Not valid Not valid Not valid
Floating Point Not valid Not valid Valid Valid See Note 2 Valid Not valid Not valid Not valid
Date See Notes 6 and 7 Not valid See Note 6 See Note 6 Not valid Not valid Valid Not valid Not valid
Time Not valid Not valid See Note 4 Not valid Not valid Not valid Not valid Valid Not valid
Time- stamp Not valid Not valid Not valid Not valid Not valid Not valid See Note 5 See Note 5 Valid

Notes:

  1. Valid only if the number of characters (or bytes) equals the number of digits and the character (or hexadecimal) field is not defined as a variable-length field.

  2. Valid only if the binary field has a decimal precision of zero.

  3. Valid only if both fields have the same decimal precision.

  4. The system generates the field length for you so do not enter a length in columns 30 through 34. The length does not include the separator character.

  5. Valid only if the field is input only.

  6. You may specify a field length (columns 30 to 34) for these data types on a logical file field. If you do not specify a length, the system will generate a default length. Valid lengths for these data types are documented with the DATFMT keyword.

  7. DBCS field types are not allowed to be mapped over DATE fields.


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