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


  • Subject: Re: Activation Groups & File Overrides
  • From: Scott Klement <klemscot@xxxxxxxxxxxx>
  • Date: Fri, 12 May 2000 17:14:54 -0500 (CDT)

     
Jon, 

OVRDBF & DLTOVR don't close open files.  They allow you to change the
scope of the open and misc attributes of the file before you open it,
but they don't open or close the files.
     
What you're probably looking for is activation groups.  You are using
QILE (the default) which you're probably never reclaiming.
     
You've basically got 4 options for an activation group when you
compile a program:

1) You can use the "default" activation group, which is the one where
     your older (OPM) programs run.  This activation group remains until
     the job ends.

2) "Caller" activation group.  This means that your program will run in
     the same activation group as the program that called it.

3) "New" activation group.  A new activation group is created when your
     program starts, and it ends when the program ends.

4) "named" activation group.  (You can choose just about any name you
     like) This activation group begins when the first program that uses
     it begins, and ends when you "reclaim" it (using the RCLACTGRP cmd
     or calling an API).

In your case, it sounds like you're binding a *MODULE directly into your
program (as opposed to calling another program or service program).  
So, a simple solution to the problem would be to do the following:

1)  Use ACTGRP(*NEW) when you do your CRTPGM command.
2)  When you call your program, it will create a new activation group.  
3)  When your program calls the bound module, it will run in this same
      activation group.
4)  Your program calls the module many times, the module always ends with
      *INLR turned off, so the files are kept open (etc) for the next
      call.
5)  Finally, when the program itself ends, the activation group ends.
      This forces all of the files to close, etc.


If you wanted, you could do something similar with a named activation   
group:
      
1)  Use ACTGRP(MYACTGRP) when you do your CRTPGM command.
2)  When your program starts, the activation group begins.
3)  Your program calls the module many times, each time the
       module keeps the files open by ending with *INLR off.
4)  Finally your program ends.  All the files stay open.
5)  Perhaps the user runs your program a few times.  Since you
       havent reclaimed the activation group, you save the overhead
       of having to create a new activation group and reopen everything.
6)  Finally, at some point the user or another program issues a
       RCLACTGRP ACTGRP(MYACTGRP) and the files and other resources
       get cleaned up.

I think you get the idea.
       
You might find it helpful to read up on activation groups in the ILE
Concepts manual.

HTH....



On Fri, 12 May 2000, Jon Erickson wrote:

> I'm attempting to separate a common subroutine into its own module, (MOD1)
> to be bound and callable from other programs/modules.
> 
> The Module opens File1 for input.  I'd like to be able to call this module
> repeatably without the file initialization overhead, yet not have to call
> the module an additional time just to seton LR to close the file. 
> 
> I've tried 'OVRDBF FILE(FILE) OVRSCOPE(*CALLLVL) SHARE(*YES)' from a calling
> RPGLE using QCMDEXC & USROPN, but the the file still is open, (Scope
> *ACTGRPDFN, Group QILE), after the calling RPGLE DLTOVR & CLOSE opcode and
> seton LR.
> 
> Any insight appreciated..
> 

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

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.