Figure 62 shows how to specify character and numeric strings for the RANGE keyword.
Figure 62. Specifying the RANGE Keyword (Example 1)
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 00010A R RECORD PFILE(PF1) A 00020A FIELDA 1 0 RANGE(2 5) (1) 00030A FIELDB 1 RANGE('2' '5') 00040A FIELDC 00050A K FIELDD 00060A S FIELDA RANGE(1 4) (2) A
In Figure 62, RANGE ((1)) is specified for FIELDA and FIELDB as a validity checking keyword for display files that refer to FIELDA and FIELDB. In the display file, RANGE requires that the work station user type only 2, 3, 4, or 5 in FIELDA or FIELDB. FIELDA is a numeric field and FIELDB is a character field. The type of field you specify depends on the high-level language the program is written in.
RANGE ((2)) is specified as a select/omit keyword for FIELDA. Records from the physical file PF1 are retrieved through this logical file record format only if the value of FIELDA is 1, 2, 3, or 4.
Figure 63 uses hexadecimal character strings when specifying the RANGE keyword.
Figure 63. Specifying the RANGE Keyword (Example 2)
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8 00010A R RCD1 PFILE(PF1) 00020A CODEA 00030A FLD1 00040A FLD2 00050A K FLD1 00060A S CODEA RANGE(X'51' X'54') A
RANGE is specified as a select/omit keyword for CODEA (which is a 1-byte field). Records from physical file PF1 are retrieved through this record format only if the value of field CODEA is from hex 51 through hex 54.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.