DDS for physical and logical files


DFT (Default) keyword--physical files only

Use this field-level keyword to specify a default value for a field.

The format of the keyword is:

DFT('value' | numeric-value | X'hexadecimal-value' | *NULL)

Without this keyword, character and hexadecimal fields default to blanks and numeric fields default to zeros. However, if you specify the ALWNULL keyword for the field, then the character, hexadecimal, and numeric fields default to the null value.

The following rules apply to the specified value:

The value specified is assigned to the field in the following cases:

The specified value is supplied to the program when the program does an input operation to a join logical file and all of the following are true:

This keyword does not affect the physical file on input operations.

Example:

The following example shows how to specify the DFT keyword.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A          R RECORD1
00020A            CHARFLD1      20A         DFT('Sample field')
00030A            CHARFLD2       5A         DFT(X'D985955185')
00040A            HEXFLD1        3H         DFT('ABC')
00050A            HEXFLD2        3H         DFT(X'C1C2C3')
00060A            NUMFLD1        5S 0       DFT(99999)
00070A            NUMFLD2        5S 2       DFT(999.99)
00080A            NUMFLD3        5S 2       DFT(999)
00090A            NUMFLD4        5S 2       DFT(*NULL)
00100A                                      ALWNULL
00110A            NUMFLD5        5S 2       DFT(999.99)
00120A                                      ALWNULL
00130A            DATFLD1         L         DATFMT(*MDY) DATSEP('-')
00140A                                      DFT('12-31-91')
00150A            TIMFLD1         T         DFT('11.15.00')
     A

The default value for CHARFLD1 is 'Sample field'. The default value for CHARFLD2 is hex D985955185. The default value for HEXFLD1 is C1C2C3 (the hexadecimal representation of the character constant). The default value for HEXFLD2 is C1C2C3. The default value for NUMFLD1 is 99999 (no decimal character is required because the field has zero decimal positions). The default value for NUMFLD2 is 999.99. The default value for NUMFLD3 is 999 (no decimal character is required if you do not need to specify decimal values). The default value for NUMFLD4 is the null value (ALWNULL is a required keyword for the field if DFT(*NULL) is specified). The default value for NUMFLD5 is 999.99; the field also allows the null value. The default value for DATFLD1 is 12-31-91. The default value for TIMFLD1 is 11.15.00 (*ISO format).


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