|
This will work but handling exceptions adds overhead - a consideration if this is to be widely implemented - plus you get a lot of extra &*&% in your job log. It also doesn't cater for situations where the called program is library qualified (not a big deal I admit). I'll take Carl up on his offer to post it on his BBS. > -----Original Message----- > From: Bob Crothers [SMTP:bob@cstoneindy.com] > Sent: Friday, July 09, 1999 2:10 AM > To: 'MIDRANGE-L@midrange.com' > Subject: RE: Recursive Calls--what I use > > Here is the little CL program I use to tell if a program is already in > > the call stack. Pass it a 1 character result field and the program > name. If it is NOT in the call stack, the a blank will be returned. > If it IS in the stack, then 'A' is returned. > > Regards, > Bob Crothers > > PGM PARM(&RESULT &PGMNAME) > > DCL VAR(&RESULT) TYPE(*CHAR) LEN(1) > DCL VAR(&PGMNAME) TYPE(*CHAR) LEN(10) > > CHGVAR VAR(&RESULT) VALUE(' ') > > SNDPGMMSG MSG(XXXX) TOPGMQ(*PRV (&PGMNAME)) > MONMSG MSGID(CPF0000) EXEC(RETURN) /* Program is + > NOT in the call stack */ > > CHGVAR VAR(&RESULT) VALUE('A') /* Program IS in the + > > call stack */ > > ENDPGM > > > > -----Original Message----- > From: zylka.marc@westpoint-stevens.com > [SMTP:zylka.marc@westpoint-stevens.com] > Sent: Friday, July 09, 1999 7:36 AM > To: MIDRANGE-L@midrange.com > Subject: Re:Recursive Calls > > > > Tim, I'd love to have a copy of that command. That should be the > easiest way to > limit > someone from calling program B again. > > Thanks, > Marc Zylka, 228-5267 > > > ____________________Reply Separator____________________ > Subject: RE: RE: Recursive Calls > Author: <MIDRANGE-L@midrange.com> > Date: 7/8/99 6:08 PM > > Hey, I have a little command that can check to see whether a given > program is in the current jobs stack. I used to use it to prevent > recursion for a menuing system I had once. Anyone want a copy? > Tim > > > > > +--- > | This is the Midrange System Mailing List! > | To submit a new message, send your mail to MIDRANGE-L@midrange.com. > | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. > | To unsubscribe from this list send email to > MIDRANGE-L-UNSUB@midrange.com. > | Questions should be directed to the list owner/operator: > david@midrange.com > +--- > > +--- > | This is the Midrange System Mailing List! > | To submit a new message, send your mail to MIDRANGE-L@midrange.com. > | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. > | To unsubscribe from this list send email to > MIDRANGE-L-UNSUB@midrange.com. > | Questions should be directed to the list owner/operator: > david@midrange.com > +--- +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-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 mailing list archive is Copyright 1997-2025 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.