Real recursive call in RPGLE

There is a way to call a program that is already on the program stack. But it is not a recommended method since it is resource intensive. It simply involves creating the program as an ILE program with the attribute of *NEW for activation group. Each call of the program will create a new activation group (the expensive part) but you can have a program call itself. I would not recommend this with anything that must do many calls before deciding to end. I've used this technique only to process program-references files that we rebuild nightly. A utility program we use will perform a implosion/explosion on a given programs usages (who calls it, the implosion, and what it calls, the explosion.)

Point is, this use of a program that calls itself by creating a new activation group won't be creating umpteen-zillion activations, only 5-6 on average, maybe as high as 10-15 to display the usages of some our programs. So there really isn't a lot of expense. 'Course it does help to have a max'd out 820 system.


The Best Web Links: tips, tutorials and more.

Ask your programming questions--or help out your peers by answering them--in our live discussion forums.

Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.

This was first published in September 2001

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.