RANGE (Range) keyword for physical and logical files

You can specify this keyword at the field level, the select- or omit-field level, or both.

The format of the keyword is:
RANGE(low-value high-value)

Example 1

The following example shows how to specify character and numeric strings for the RANGE keyword.

|...+....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 this example, 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 workstation 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.

Example 2

The following example uses hexadecimal character strings when specifying the RANGE keyword.

|...+....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 hexadecimal 51 through hexadecimal 54.