|
From: "Joe Pluta" <joepluta@PlutaBrothers.com> Date: Fri, 28 Dec 2001 13:30:11 -0600 Joe, my answers inline. I realize that the thread resolved many of the questions, but I didn't see any clear statement of how LR works, so I'll post this anyway. >Here's a question: in good old RPG III, I often used the technique of >calling a program repeatedly without setting on LR. I usually had a control >program that, at the end of its processing, then called each of the >subprograms and told them to shut down. Each subprogram then seton LR and >ended. > >This was excellent for performance, and at the same time cleaned up the >subprograms between calls to the control program. > >In my move to RPG ILE, I'm wondering how to handle this. I'd like to change >the called programs to bound calls (CALLB), and then bind them all in. If I >do a CALLB to a program, what are the effects of *INLR? > >1. If the called program does not set on LR, I assume that subsequent calls >do not go through the initialization, just like in the old OPM CALL >situation. That's correct. >2. If the calling program sets on LR and then ends, does this in effect set >LR on in all the called programs, clearing them from the PAG? That is, the >next time I call the control program and it in turn does a CALLB to the >subprogram, does the subprogram go through initialization again? No. Each module has its own set of indicators, including LR. Besides that, only DFTACTGRP(*YES) programs get cleared from the PAG when they end with LR on. Actgrp *CALLER ILE programs running in the default activation group stay in the PAG, but get marked for reinitialization by RPG internally and by the system (in a different way) if an RCLRSC gets done. Named actgrp programs get marked for reinitialization by RPG. From the system's point of view, the program is still active, when it's RPG that marks a program for initialization - it's just an internal variable that the program sets for itself, saying to reset everything on the next call.) The operating system itself has no concept of "LR". With non dftactgrp(*yes) programs, the program goes out of the PAG when the activation group ends. (I'm not sure that "PAG" is even the correct term here, but the concept is the same.) >3. If I set on LR in a called program and it returns, does that in effect >set on LR in the calling program? No. See 2. Barbara Morris
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.