× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Jim Wiant wrote:
It's one of those days when I think that everything I thought I knew
isn't true anymore....
RPG program A does a dynamic call to RPG program B.
I've confirmed everything is running in the same activation group.
Program B uses the INFDS to see if a given file is open. If it's not, it
opens it. The program then does a RETURN to exit- saving the pain of
opening the file again next time. Subsequent calls show the file as
being opened, so that's all working exactly like expected.
Program A eventually sets *INLR on when it exits.
But the file program B opened stays open.
I was certain the *INLR being set in program A would close all open
files, but obviously not.

Each RPG module has its own private *INLR. If program A only has one module, then setting on *INLR in program A would only close the files in that program. If program A has more than one module, then setting on *INLR in one of the modules would only close the files in that module.

You could have program A call program B with no parameters to indicate that it should seton LR. (Or if B has no parameters, add one that indicates it should seton LR.) Check %PARMS, and if zero (or one), seton LR and return. Otherwise, do the usual thing.

To get all the files in the activation group to be automatically closed, you need to reclaim the activation group. You could do that
- by having program A call CEETREC
- by having program A in activation group *NEW and program B in *CALLER
- by changing program A to a CLLE program and having it your old program A; then when old program returns, the CLLE would do a RCLACTGRP.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.