The application and file name must be specified and must be the same as the Process Control File (PCF) of the input process. The Access Key Field name must be a valid key for the specified file. SCAN is available during entry of the key field name and only defined keys are presented as choices. Execution of a SELECT statement effectively instructs the input process to use the specified access path (key) the next time that the input process enters KEY ENTRY. At that point, the user will be prompted to enter a key value for the specified access path.***** SELECT *** ******** KEY IS ********************** (1) (2) (3) (4)
(1) T/F execution conditions (2) Application ID (3) File name
(4) Access key field name
       *   First, we disable the SELECT ACCESS PATH option (F3)
      IF --- OPTION                    EQ     SELECT ACCESS PATH
T     SET --- OPTION                     =
      *   Next, use the SELECT statement to set the desired path
      IF --- OPTION                    EQ     USER 1
T     SELECT TST TEST42                       KEY IS  TEST42 CATEGORY
F     IF --- OPTION                    EQ     USER 2
FT    SELECT TST TEST42                       KEY IS  TEST42 REGION
FF    IF --- OPTION                    EQ     USER 3
FFT   SELECT TST TEST42                       KEY IS  TEST42 ID NO
FFF   END
      *   Ignore these buttons if pushed in ADD mode
      IF --- MODE                      EQ     ADD
T     END
      *   Now, push the options into the stack to switch into KEY ENTRY
      *   and redisplay the records (remember, last in, first out)
      SET --- OPTION                     =     RETURN
      PUSH --- OPTION                    FIELD
      *
      IF --- MODE                      EQ     DELETE
T     SET --- OPTION                    =      DELETE MODE
F     IF --- MODE                      EQ     CHANGE
FT    SET --- OPTION                    =      CHANGE MODE
FF    SET --- OPTION                    =      INQUIRE MODE
      PUSH --- OPTION                    FIELD
 
Finally, just add three lines of code to the beginning of the Pre-Display event point:
IF --- INTERACTIVE PHASE NE DATA SCROLL T POP --- OPTION FIELD T END
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.