× 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.



Hi, David:

DFTACTGRP solution
=================
Assuming all of these *PGMs are in fact running in the *DFTACTGRP, then you can just issue:

RCLRSC LVL(*)

in PGM1(CLP), right after the CALL to PGM2 returns to PGM1. This will close all open files and end all active programs below the current level in the call stack.

NOTE: if somehow PGM4 or PGM5 were not compiled with CRTBNDRPG ... ACTGRP(*DFTACTGRP) then this will not work. :-o

Named Activation Group solution
=========================
Another alternative would be to convert all of the called OPM programs to ILE -- CLP to CLLE, and RPGIII to RPGLE, and create PGM2 with a named activation group, e.g. ACTGRP(PGM2) ... and create all the programs it calls with ACTGRP(*CALLER). Then, when PGM2 returns to PGM1, PGM1 issues:

RCLACTGRP ACTGRP(PGM2)

This is one of the main benefits of using ILE with named activation groups -- you can control termination of a named activation group far more easily than with RCLRSC in "OPM compatibility mode" (in the *DFTACTGRP).

I hope this makes sense ...

All the best,

Mark S. Waterbury

> On 9/7/2010 10:05 AM, David FOXWELL wrote:
Hi all,


Our RPG OPM's always had a parameter ReturnType so that we could instruct them to return with either RT or LR on. At the end of processing, the caller would use a cleanup routine to call all the programs that had been activated. The called programs would then just set on LR and end.

For some reason unbeknown to me, this method was not used with RPGIV programs.

Now, this (simplified)situation has "evolved" :

PGM1(CLP)
PGM2(RPGIII)
PGM3(RPGIII)
PGM4(RPGIV)
PGM5(RPGIV Converted from RPGIII)

Everything is running in DFTACTGRP.

When PGM2 is finished, it will call PGM3 with ReturnType to tell it to switch on LR and return. PGM4 does not have this facility and always returns with LR off. As it does not know what PGM3 is doing, it never calls PGM5 to tell it to set on its LR indicator and its files stay open.

On returning to PGM1, I need PGM5 to be freed up. A file it uses is staying open. The boss says to issue a call from PGM2 or PGM3 to PGM5 to get it to switch on LR. I don't know if that would even work, would it? Even if it did, there are other RPGIV called by PGM5 that would probably give the same problem. How do I get out of this mess?


TIA.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.