Problem solve Get help with specific problems with your technologies, process and projects.

A simpler way to name RPG indicators

Here's a simpler way to name RPG indicators.

Two techniques for naming RPG indicators are well known. Using INDARA in the display file has some side-affects that might require more coding to work around. Using a based array to overlay the built-in indicator array *IN can be hard to understand for those not used to working with pointers. Both techniques can impact maintainability because it's not obvious when an *IN indicator is being referenced.

Here's one I've never seen offered. I think it benefits from being simpler than other methods, and it has no side affects.

Use named constants to name the indicator array index values:

d exitKey c 3 d promptKey c 4 d cancelKey c 12 c if *in( exitKey ) c exsr exitPgm c elseif *in( promptKey ) c exsr callFinder c elseif *in( cancelKey ) c exsr return c endif

Dig Deeper on RPG iSeries programming