RPGLE Getting around recursive calls

1,380 pts.
Tags:
AS/400 Procedure Pointer
AS400 RPGLE
CLP
RPGLE
With proceedures I read that recursive calls are allowed.  No time to get into proceedures.

clp calls, pgm1.

pgm1 add function displays scrn2, then calls pgm2, pgm2 calls pgm3, pgm3 calls pgm4.

pgm1 update function calls pgm4.

Issue is that pgm4 can call pgm1, pgm2, pgm3, pgm5, pgm6.  On the call to pgm1 a recursive call occurs resulting in RNX8888. 

I added

HDFTACTGRP(*NO) ACTGRP(*CALLER)

to all programs, to no avail.

My thoughts on this are: since all parms used between the programs are loaded to the *LDA, end the RPG's with LR = *on and return to the clp.  Let the CLP rtvdtaara *lda and sort out which program to go to next.  Flds in the LDA are;



D LDA_DS         UDS                  dtaara(*LDA)                                            D  LDACNUM                1      9  0                                      Claim number       D  LDAMODE               10     18                                         Mode               D  LDARTNIND             19     20  0                                      Return Indicator   D  LDACUST               21     28  0                                      Customer/Location # D  LDACODE               31     38  0                                      Plumber Code       D  LDADETLN              39     41  0                                      Detl/DetD line #   D  LDASEQ#               43     45  0                                      DetD Sequence #   



I could easily add caller and called pgm to the lda.

What are your thoughts on getting around this?  Is there a quicker way?

The better way may be to use proceedures.  Iam not sure about what all would have to be changed.   I have never used them, now is when I don't have the time to learn it.

All ideas welcomed.

nick



Software/Hardware used:
as400 rpgle
ASKED: June 24, 2011  6:12 PM
UPDATED: June 24, 2011  7:26 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Changed the H spec to:
H DFTACTGRP(*NO) ACTGRP(*NEW)

It works.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

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

Forgot Password

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

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

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

Thanks! We'll email you when relevant content is added and updated.

Following