Data type for physical and logical files (position 35)

For a physical file, you use this position to specify the data type of the field within the database. You 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 files on which the logical files are 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
5
Binary character
Note: The data types J (only), E (either), O (open), and G (graphic) support DDS database files that use DBCS. The G (graphic) data type also supports DDS database files that use UCS-2 or UTF-16. The A (character) data type also supports database files that use UTF-8.
For physical files, if you do not specify a data type or duplicate one from a referenced field, the operating system assigns the following defaults:
  • A (character) if the decimal positions 36 through 37 are blank.
  • P (packed decimal) if the decimal positions 36 through 37 contain a number in the range 0 through 63.
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 that 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 the data types of physical and logical file fields, where valid conversions are marked with an X or with a reference to the table notes:

Data type of physical file field Data type of logical file field
A H S P B F L T Z UTF8 UTF16 UCS2 O J E G 5
Character (A) X X 1             X X X X   X   X
Hexadecimal (H) X X 1                   X X X   X
Zoned (S) 1 1 X X 2 X                     1
Packed (P)     X X 2 X                      
Binary (B)     2 2 3 2                      
Floating Point (F)     X X 2 X                      
Date (L) 6,7   6 6     X                    
Time (T)     4         X                  
Timestamp (Z)             5 5 X                
UTF-8 X                 X X X X     X  
UTF-16 X                 X X X X     X  
UCS-2 X                 X X X X     X  
Open (O)   X               X X X X       X
Only (J)   X                     X X X X X
Either (E)   X                     X   X   X
Graphic (G)                   X X X X X X X  
Binary character X X 1                   X X X   X
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 can 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 generates 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.