If you specify any function keys, you can use the PROCESS_FCNKEY tool in combination with any of the display statements to create a loop that automatically processes the user’s PF key selections. For example, the following two rules show how the
PROCESS_FCNKEY tool and the DISPLAY & TRANSFERCALL statement could be combined to provide pseudo-conversational processing of PF keys.
The PROCESS_EXPENSES rule is called first. The first two lines initialize the scroll amount field. The third line displays the EMPLOYEE_EXPENSE screen and transfercalls to the EXPENSE_LOOP rule.
The first line of the EXPENSE_LOOP rule uses the PROCESS_FCNKEY tool to handle any PF key selection the user makes. The second statement redisplays the screen and does a recursive transfercall back to this same rule to process the next user PF key use. One of the function keys must signal the EXIT_DISPLAY exception. This causes the loop to complete.