INLR, RPGLE

370 pts.
Tags:
*INLR
AS/400
RPGLE
Why do we specify *inlr at the end of program only. What difference would it make if we specify it in beginning?

Software/Hardware used:
as400, rpgle,

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • WoodEngineer
    *INLR can be set on at the beginning of the program but not in the *INZSR sub-routine.  I find it a handle coding technique.  Of course, this assumes the RPG cycle is not used.

    A few years ago there was an article in one of the IBM i newsletters which advocated this approach.
    6,670 pointsBadges:
    report
  • BigKat
    you can specify *INLR any time you want to
    8,200 pointsBadges:
    report
  • TomLiotta

    Why do we specify *inlr at the end of program only.

    We don't. I regularly specify it at the start if I know it's always expected.

    Tom

    125,585 pointsBadges:
    report
  • Durgesh813
    WoodEngineer can I get the link of that IBM discussion so that I can go through it?
    370 pointsBadges:
    report
  • WoodEngineer
    Sorry . . . I do not have the link to the discussion on setting on *INLR at the top of the program.

    BigKat - I tried *INLR in *INZSR subroutine.  The program ended before getting to the mainline code.  Next, *INLR was moved to top of main line and everything worked.  Maybe things have changed since I did that a couple of years ago.
    6,670 pointsBadges:
    report
  • philpl1jb

    Makes sense that you wouldn't like the results of putting the INLR in the *INZSR.

    Since *INZSR is run by the cycle.  When it ends the cycle goes through it's checklist of stuff before going to "Main" .. in that checklist is the *end if *inlr so it ends.

    Remember that if you end the program without setting *inlr on, the resources stay open and if you call the program again initialization doesn't occur.

    49,950 pointsBadges:
    report
  • Durgesh813
    what happens if i have to read the same PHYSICAL file from t2o programs pgm1 and pgm2.... PGM1 reads pf in a dow (till not end of file pf) and if it enters do while it calls PGM2. pgm2 agains reads the same physical file. but when it returns back the control to PGM1 it doesnt sety the *INLR to *ON ...

    now suppose the PGM1 has read 1st record... it goes to pgm2.... which record will pgm2 read 2nd or first... and after that when the control passes back to the first pgm1. which record will PGM1 read 2nd or 3rd (WHEN THE ITERATION OF THE DO_WHILE IS 2nd times )   points to consider PGM1 has do while loop. PGM2 doesnt have any loop just a read statement to read physical file and a return statement... 
    370 pointsBadges:
    report
  • TomLiotta

    what happens if i have to read the same PHYSICAL file from t2o programs pgm1 and pgm2....

    Nothing happens. Pgm1 reads the records that it wants, and Pgm2 reads the records that it wants.

    The two programs will only interfere with each other if you decide to make them interfere, e.g., by sharing an ODP. And if you do that, then the programs again will read the records that you told them to read.

    Tom

    125,585 pointsBadges:
    report
  • Durgesh813
    thanks TomLiotta 
    370 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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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

Following