895 pts.
 RPGLE
I've display file in RPGLE program...

I want to display function key F19=View History based on certain condition. I planned to use indicator to swith on if the condion 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:
AS400
ASKED: October 13, 2009  7:23 PM
UPDATED: October 26, 2009  4:18 PM

Answer Wiki:
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 Phil ********************* -- 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
Last Wiki Answer Submitted:  October 14, 2009  6:20 pm  by  philpl1jb   44,150 pts.
All Answer Wiki Contributors:  philpl1jb   44,150 pts. , CharlieBrowne   32,835 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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

 107,995 pts.

 

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.

 5,505 pts.

 

Don’t use indicators for your function keys, use the AID field in the DSPF INFDS.

 5,670 pts.

 

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

 

…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

 107,995 pts.

 

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.

 1,565 pts.

 

Something else you can do is create your own indicator. For example:

D VALID_FIELD S N INZ(*OFF)

 5,830 pts.