Difference: SELECTILFStatement (1 vs. 3)

Revision 32008-10-07 - SteveFrizzell

Line: 1 to 1
 
META TOPICPARENT name="APPX500Features"

SELECT ILF Statement

Line: 6 to 6
 
Changed:
<
<

SELECT

>
>

SELECT Statement

  The SELECT statement allows the access path of in input process to be changed dynamically. The structure of the statement is: 


Changed:
<
<

***** SELECT * ******************** * ************* (1) (2) (3) (4) (5)

>
>

***** SELECT * ****** KEY IS ******************** (1) (2) (3) (4)

 (1) T/F execution conditions  (2) Application ID
Changed:
<
<
(3) File Name, field name, or predefined field (4) Occurrence (constant/index) (5) Data item type (FIELD, RECORD, DEFAULT FIELD, DEFAULT RECORD, ORIGINAL FIELD, ORIGINAL RECORD)
>
>
(3) File name

(4) Access key field name

 
Deleted:
<
<
The SELECT statement allows the access path of in input process to be changed dynamically. The structure of the statement is:
 
Changed:
<
<
      SELECT  AAA FILENAME                        KEY IS  _____________________________
The application and file name must be specified, even though this statement is relevant only for the Process Control File (PCF). SCAN is available for the key field name, and only defined keys are presented as options.
>
>
The application and file name must be specified and must be the same as the Process Control File (PCF) of the input process.
 
Changed:
<
<
One reasonable use for the SELECT statement would be to facilitate access path switching by users, without them having to use F3 (SELECT ACCESS PATH), and perhaps in that way limiting which keys they can select. Note that the SELECT statement does not force KEY ENTRY phase, so, without further coding, a user not in KEY ENTRY would see no immediate change in view. It would seem that a valuable use would be to redisplay a scrolling screen using an alternate key, and to do so, the above defined PUSH and POP statements come in very handy. Here's an example:
>
>
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.
 
Changed:
<
<
The file is called TEST42. The primary key is TEST42 ID NO.. Alternate keys are defined as TEST42 CATEGORY and TEST42 REGION. The screen has three buttons defined, linked to User Option 1, 2, and 3. The Option Intercept Event Point contains the following code:
>
>
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.

ACCESS PATH Predefined Field

 
Added:
>
>
Also related to the SELECT statement is a Pre-Defined Field called --- ACCESS PATH. This field contains the value of the current access path for the Process Control File. The field may be viewed, but not changed via ILF code (that is to say, an ILF statement to SET --- ACCESS PATH to a specified value will be ignored).

Examples:

One reasonable use for the SELECT statement is be to facilitate access path switching by users of a scrolling input process. For example, an input screen could be designed to include three buttons that the user could use to select the desired access path for the input process. Note that the SELECT statement does not force KEY ENTRY phase, so, without further coding, a user not in KEY ENTRY would see no immediate change in view.

In the following example, the file name is TEST42. The primary key is TEST42 ID NO.. Alternate keys are defined as TEST42 CATEGORY and TEST42 REGION. The screen has three buttons defined, linked to User Option 1, 2, and 3. The Option Intercept Event Point contains the following code:

 

Changed:
<
<
    • 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
>
>
    •     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
Changed:
<
<
    • Ignore these buttons if pushed in ADD mode IF --- MODE EQ ADD
>
>
    •     Ignore these buttons if pushed in ADD mode IF   --- MODE EQ ADD
 T END
Changed:
<
<
    • 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
>
>
    •     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
  *
Changed:
<
<
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
>
>
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
 
Added:
>
>
 
Changed:
<
<
Finally, just add one line of code to Pre-Display:
      POP     --- OPTION                    FIELD

Also related to this new statement is a new Pre-Defined Field called --- ACCESS PATH. As one might assume, the field contains the value of the current access path for the Process Control File. The field may be viewed, but not changed via ILF code (that is to say, an ILF statement to SET --- ACCESS PATH to a specified value will be ignored).

Limitations:

>
>
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
 

Comments:

Read what other users have said about this page or add your own comments.

Revision 22008-10-06 - SteveFrizzell

Line: 1 to 1
 
META TOPICPARENT name="APPX500Features"

SELECT ILF Statement

Line: 7 to 7
 

SELECT

Added:
>
>
The SELECT statement allows the access path of in input process to be changed dynamically. The structure of the statement is: 

***** SELECT *** ********************** *** *************** (1) (2) (3) (4) (5)

(1) T/F execution conditions  (2) Application ID (3) File Name, field name, or predefined field (4) Occurrence (constant/index) (5) Data item type (FIELD, RECORD, DEFAULT FIELD, DEFAULT RECORD, ORIGINAL FIELD, ORIGINAL RECORD)

 The SELECT statement allows the access path of in input process to be changed dynamically. The structure of the statement is:

Revision 12008-10-01 - SteveFrizzell

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="APPX500Features"

SELECT ILF Statement

Release 5.0.0 of APPX implements the SELECT ILF statement.

SELECT

The SELECT statement allows the access path of in input process to be changed dynamically. The structure of the statement is:

      SELECT  AAA FILENAME                        KEY IS  _____________________________
The application and file name must be specified, even though this statement is relevant only for the Process Control File (PCF). SCAN is available for the key field name, and only defined keys are presented as options.

One reasonable use for the SELECT statement would be to facilitate access path switching by users, without them having to use F3 (SELECT ACCESS PATH), and perhaps in that way limiting which keys they can select. Note that the SELECT statement does not force KEY ENTRY phase, so, without further coding, a user not in KEY ENTRY would see no immediate change in view. It would seem that a valuable use would be to redisplay a scrolling screen using an alternate key, and to do so, the above defined PUSH and POP statements come in very handy. Here's an example:

The file is called TEST42. The primary key is TEST42 ID NO.. Alternate keys are defined as TEST42 CATEGORY and TEST42 REGION. The screen has three buttons defined, linked to User Option 1, 2, and 3. The Option Intercept Event Point contains the following code:

      *     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 one line of code to Pre-Display:

      POP     --- OPTION                    FIELD

Also related to this new statement is a new Pre-Defined Field called --- ACCESS PATH. As one might assume, the field contains the value of the current access path for the Process Control File. The field may be viewed, but not changed via ILF code (that is to say, an ILF statement to SET --- ACCESS PATH to a specified value will be ignored).

Limitations:

Comments:

Read what other users have said about this page or add your own comments.
<--/commentPlugin-->

-- SteveFrizzell - 01 Oct 2008

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback