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



Walden -

In V3R2 (and V3R7, obviously) you can create recursive RPG 
subprocedures, which should allow you to create a recursive program. 
 I haven't needed to do it, yet, and it might take a CLLE entry 
module, but it should be fairly straightforward.  Can you wait until 
you make that upgrade on the development machine?

An alternate, but ugly way to do it would be to have your trigger 
program be a CL program (since CL can be recursive) and have some sort 
of QTEMP data area counter/flag/lock to keep track of how many times 
the trigger is active in your current job.  Then you could have the CL 
call the next of several copies of the same RPG program (TRIGCOPY1, 
TRIGCOPY2, TRIGCOPY3, etc).

Larry Paque
Echo Service Company
larry@paque.org


Date: Tue, 20 May 1997 23:18:14 -0400
From: "Walden H. Leverich III" <walden@techsoftinc.com>
Subject: Recursive Triggers and ILE/RPG

I have a trigger that updates the same file that the trigger is 
attached
to. That is to say, File F has a before update trigger T. Program T 
updates
file F (a different record in file F than the one that caused the 
trigger
to be fired) The problem I have is that this scenario results in 
recursive
calls to the RPG program. This is not a problem if the program is an 
ILE
program that has specified ACTGRP(*NEW) on the create, but it means 
that a
new activation group is being created for each invocation of this 
program.
Each base update can result in up to 5 triggered updates, and I am 
looking
at 30 to 40,000 base updates each night, resulting in the creation 
and
destruction of 150 to 200,000 activation groups in this job. Now, on a 
530
this is not the end of the world, but I would like a better solution. 
Any
ideas?

Thanks,
- -Walden

PS. Production is V3R7, but development is V3R1.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the Midrange System Mailing List!  To submit a new message,   *
* send your mail to "MIDRANGE-L@midrange.com".  To unsubscribe from     *
* this list send email to MAJORDOMO@midrange.com and specify            *
* 'unsubscribe MIDRANGE-L' in the body of your message.  Questions      *
* should be directed to the list owner / operator: david@midrange.com   *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.