AS/400: How to reuse field indicator

15 pts.
Tags:
AS 400
AS/400 Display File
How to reuse field indicator in a display file in AS/400?
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 9  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.
  • TheRealRaven
    The question is very unclear. You can use and reuse the indicators as many times as you wish. To discuss any further, you need to tell your OS version as well as the language(s) you would code in.
    34,990 pointsBadges:
    report
  • ToddN2000
    What do you mean by reuse? If you are running out of indicators check you code. IF you are using then for things like CHAIN and READ opcodes, try using the built in functions like %FOUND to free them up.. Come back with more specifics you if you still need help.
    132,520 pointsBadges:
    report
  • TheRealRaven
    For "display" indicators, the only real concern is that there is a limit of 99 per screen. They may be reused for each screen, or each screen can have a completely separate set of indicators. Display indicators may be the same as the 99 general program indicators for RPG or, again, completely separate.

    Regardless, the OS version and programming language(s) will matter.
    34,990 pointsBadges:
    report
  • ToddN2000
    If the programs are getting that complicated you are running out of indicator it may be a good time to consider breaking the program into easier to manage modules when possible. 
    132,520 pointsBadges:
    report
  • TheRealRaven
    Nowadays, there are only a few cases where display indicators are required, and those are almost all subfile related so only a few are needed. There should be no reason to run out of display indicators. And indicator fields make running out of program indicators effectively impossible.
    34,990 pointsBadges:
    report
  • ToddN2000
    Another option, although you should never be in this situation if it's coded efficiently, is use work fields. If you want to reuse *IN30 for another display file record but sit be able to go back a screen and have the original value would be a work field. Something with the record so you can keep them straight like  rec1_IN30  or rec2_IN30.
    Store the values in the work field before you display the new record and reload any old values if this is a re-display..Your code may get messy and be hard to follow but it is possible. 
    We would need to see the actual code to make sure it would function.  
     
    132,520 pointsBadges:
    report
  • Amitkshukl
    I agree with therealraven. I have to add three field in a display file and all the indicators are used, please suggest a example so that I can display, underline, protact and reverseimage conditionally.
    15 pointsBadges:
    report
  • ToddN2000
    You are using all indicators in multiple display records not all in one display correct? If they are all in one display record, I cannot think of a way around it other than the overall logic needs to be re examined. In all my experience I have never used more than 30 or so in any one subfile or screen display. I used more than the 30 within the same DDS, even reused them. Post a sample of the code so can can better see what you are trying to do. Are you looking for 3 separate conditions or combine them into one using one indicator?

    something like this
    A  20                                  DSPATR(UL RI PR)

    or
    20                                  DSPATR(UL)
    21                                  DSPATR(RI)
    22                                  DSPATR(PR)
    132,520 pointsBadges:
    report
  • TheRealRaven
    Or something like this:
         A                                      DSPSIZ(24 80 *DS3)
         A                                      INDARA
         A          R DONLY
         A                                      CF03(03 'Exit')
         A            DA             1A  P
         A                                  6  3'Input alpha . :'
         A            FLD001         3A  B  6 21
         A                                      DSPATR(&DA)
         A                                 23  3'F3=Exit'
    When DA contains x'20', FLD001 will show with the 'Normal' display attribute. When it contains x'21', the display attribute will be 'Reverse image'. When it's x'22', it will show as 'High Intensity'. Etc.

    No display indicators needed.
    34,990 pointsBadges:
    report

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.

Following

Share this item with your network: