What the role of Indicators in RPGLE Programs

150 pts.
Tags:
AS/400
RPGLE
How and why do we use Indicators in RPGLE Programs. Please explain below statement
Fxxxxxx O E PRINTER OFLIND(*IN60)


Software/Hardware used:
IBM i
1

Answer Wiki

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

In your example indicator 60 is set on when there is a print line overflow on the file named in the F spec line the indicator is listed on.

This setting of the indicator can notify you when it it time to print new page headings and form/page advance. This prevent one long report with no page breaks.

Discuss This Question: 3  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.
  • Splat
    Of course, you can also create your own indicator for that.

    I tend to use overflow - it's easy enough to remember & leaves little question about what it's for.
    12,915 pointsBadges:
    report
  • WoodEngineer
    Think of an indicator as a binary switch. They can be used to control print files, display files as well as program logic.
    Named indicators can be created in your program's D-specs; just specify data type "N".
    There are also some system defined indicators, such as %FOUND, %EOF, %ERROR, etc.  
    For example, if the result of a Chain operation is successful %FOUND will be true which means it contains the value of 1.  Then in your program you can use this code:
    Chain (filekey) RecordName
    If %found ;
      (do something)
    EndIf ;
    You can also test the opposite:
    If not %found ;
      (do something else) ;
    EndIf;
    Just keep in mind that an indicator is just a binary switch.
    8,225 pointsBadges:
    report
  • ToddN2000
    Like WoodEngineer mentioned, the new system defined indicators, such as %FOUND, %EOF, %ERROR were a blessing. Int the old days when you had very large programs you would some time run out of indicators when restricted to the *IN01 - *IN99. Over the years I think programmers have gotten wise and modularized the programs and use the newer built in methods to resolve the issue of running out of indicators. , etc.
    134,845 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: