For years, I've been advocating the elimination of the function key response indicators. If you look at a typical display file, you might see something similar to the code shown below.
Note the response indicators assigned to the various function keys. As you know, when the function key is pressed, the corresponding indicator is turned on.
A INDARA
A CA03(03 'Exit')
A CF04(04 'Search')
A CF05(05 'Refresh')
A CA12(12 'Cancel')
There is no reason to use the response indicators. This display file could have been specified as follows:
A INDARA
A CA03
A CF04
A CF05
A CA12
Of course, by avoiding the use of the response indicators, the *INxx indicators are not set on. So that gives us two choices: We can use the cryptic *INKx indicators, or we can use the attention identification byte in position 369 of the workstation data structure (WSDS).
Using the *INKx indicators is one of the worst things you can do in RPG IV, so we won't bother with that technique. So that leaves the WSDS technique. To use this option, you code the following in your RPG IV program:
D WSDS DS
D FKey 1A Overlay(WSDS:369)
Then, in the Calculation specifications, you would code something similar to the following:
C When fKey = F3
C if CleanUp() = b_OK
C Return
C endif
C When fKey = F5
C callp Refresh()
C When fKey = F11
C callp ToggleDsp()
C endSL
The FKEY subfield of the WSDS references the named constants in a source member named FKEYS. It contains named constants that represent the hexadecimal value for each function key. To see a copy of the FKEY /COPY member, go here and click on the FKEYS source member.
Stop using response indicators and start using the attention identification byte. Things will be much easier for you in the future.
Bob Cozzi is a programmer/consultant, writer/author, and software developer. His popular RPG xTools add-on subprocedure library for RPG IV is fast becoming a standard with RPG developers. His book The Modern RPG Language has been the most widely used RPG programming book for more than a decade. He, along with others, speaks at and produces the highly popular RPG World conference for RPG programmers.



Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.
IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn:
LATEST COMMENTS
MC Press Online