How to condition the display option when RPG indicators are already used in RPGLE

895 pts.
As/400 Object
RPG indicators
I've got a display file in RPGLE program...

I want to display function key F19=View History based on certain condition. I planned to use indicator to switch on if the conditon meets and the option will be displayed. 

The problem here is all 01 to 99 indicators, KC,KE,KG,KJ,KQ,U2 are already used by the program.

How to condition the display option in this situation?

Software/Hardware used:

Answer Wiki

Thanks. We'll let you know when a new response is added.

Use indicators that aren’t used in this screen
Immediately before the screen put these indicators into a hold field and put your indicators in the indicator fields.. immediately after reverse the process.

hld19 = *in19
*in19 = *off
hld88 = *in88
*in88 = *off
exfmt myScreen
myScreen88 = *in88
myScreen19 = *in19
*in19 = hld19
*in88 = hld88


********************* — we wrote over each other again — begin response CharlieBrown

You need look at how all these indicators are used.
I would hope that they are not all used on the same format, that way you could use the same indicator multiple ways.
If you have any indicators that you are using in the RPG code that are not required in the DSPF, get rid of them. Use a variable to control routines in the coding.
If you are displaying different values in the same place on the DSPF by using indicators, get rid of them and populate a field and just send that to the DSPF.
Also looks like you have not used U1, U3 –> U8, L0–>L9, OA –> OG. and some *INK* indicators, so you have a long way to go before you use them all up. 😉

I forgot RT and H1 –> H9
*********************** end response CharlieBrown

that’s got to be the first line of a limerick..
There once was a programmer who ran out of indicators

… now he’s been totally depricated

Discuss This Question: 7  Replies

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • TomLiotta
    The only indicator that seems to be needed is one that enables the CA19 or CF19 F-key in the record format. Since the conditions already seem to be known in the program, any conditioning indicator(s) also would be known already. What do you need to use an indicator for? You don't need one to display the [F19=View History] text -- that can be done simply by populating a field with either blanks or the text, or perhaps with DSPATR(&P-field). Or do you need to come up with a new set of resulting indicators in the program? The real answer is to start getting rid of any indicators going to the screen and being used in the program. Except for a few subfile keywords, no other indicators are required. And numbered indicators in the program can be mostly eliminated, either by using %bifs or by substituting named indicator fields. Surely you can find a couple indicators that are used in only a couple program instructions and eliminate them. Once replaced by code that doesn't need a resulting/conditioning indicator, the previously used indicator can be used for your CA19 conditioning. Tom
    125,585 pointsBadges:
  • Yorkshireman
    Sheesh - I once had a programmer 'who ran out of indicators' your logic generally only needs one, file and diplay conditions a few more time to do surgery on the program.
    6,085 pointsBadges:
  • Splat
    Don't use indicators for your function keys, use the AID field in the DSPF INFDS.
    12,915 pointsBadges:
  • Nutangujar
    Thank you so much guys... I'was trying to add new funtionality in existing huge program... i identified some existing chain operations in the program where i can replace indicators with %found() plus i tried to use H and U indicators in display file to make the field ND but AS400 didnt like it so i cudnt... I'm really afraid of doing surgery to that existing huge and infamous program so next I'm planning to try some non-indicator logic which I'm totally unaware of... Thanks once again!!! -NG
    895 pointsBadges:
  • TomLiotta
    ...i tried to use H and U indicators in display file to make the field ND... Review a DDS manual for display files for the DSPATR keyword. In particular, look at the DSPATR(&program-to-system-field) option. You don't need an indicator to condition non-display (nor most other attributes). You define a hidden program-to-system field and put the hex attribute value into it when you write the display. For non-display, the P-field value is given as x'27' in the DDS manual. No indicator needed. Alternatively, you simply pass the text to the display in an output field. When you want it to show up, you put the text in the field. When you don't want it to show up, put blanks in the field. Tom
    125,585 pointsBadges:
  • aceofdelts
    A technique I've used on occaision uses no indicators at all. Define a text field to the length of your text (so 16 is fine for your example). Reset it to blanks and then fill it with "F19 ..." if your history criteria is met (before rendering the screen, of course). Downside is it might not support use as a hot key (all of my iSeries users do this via an "F" key anyway). Mike L.
    2,550 pointsBadges:
  • Teandy
    Something else you can do is create your own indicator. For example: D VALID_FIELD S N INZ(*OFF)
    5,860 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.


Share this item with your network: