Ok. Use QMHSNDPM and specified the program name that I want to check on
the stack entry parameter works. I get CPF2479 when program is not in
the stack. (Note: Instead of *DIAG message type, I use *RQS message
type and do a QMHRCVPM to remove it.) Not sure if this method is faster
than QWVRCSTK or not. But it sound like it should.

Thanks Chuck.

"Lim Hock-Chai" <Lim.Hock-Chai@xxxxxxxxxxxxxxx> wrote in message
news:<mailman.1939.1218050411.2545.rpg400-l@xxxxxxxxxxxx>...
Aahhh, sending a diag message. Cool trick.

I'm trying to create a decrypt export procedure to allow caller to
decrypt encrypted credit card field. Base on user authority, this
decrypt export procedure will apply appropriate masking when decrypting
the credit card field. I'm trying to add some functionality to this
procedure where it can be setup to apply different masking base on
UserID+Caller Program Name. Obviously, I can get the caller program
name without needing the caller passing the program name to me. But
some how (don't know I'll ever need it yet), I have a feeling that may
be under some special condition the caller might need to override the
program to a program name that is in the higher call stack.

As far as non-RPG, well, this service program is a RPG program. RPG has
a lot of special ability, may be and just may be, there is a special
solution that can only be found in RPG :). I guess David will let me
know if I need to move this.

thanks



"CRPence" <CRPbottle@xxxxxxxxx> wrote in message
news:<mailman.1923.1218049031.2545.rpg400-l@xxxxxxxxxxxx>...
If considering QMHSNDPM to find a program in the stack, it would be

daft to try to find entries "one level at a time." Just send a
diagnostic message to the named program, and if the error CPF24xx
"program &x not in stack" is the result, then you know it is not in
the
stack.

However whenever a design exists where a program thinks it must
know
who called it, I start to wonder if I might not have a design problem.

There should be very few required cases for that feature. It might be

worth discussing for what purpose the program name is being passed and

why the called program finds it necessary to validate the program name

is on the stack.

Why the non-RPG topics finding their way here of late, instead of
to
Midrange-L?

Regards, Chuck

Lim Hock-Chai wrote:
I've a service program that accepts program-name as one of the input
parameters. When this parameter is passed in by the caller, it will
need to determine if the passed in Program Name is actually in the
current call stack. There are two ways that I know of that can
determine if a program is on the call stack, one is using the
QWVRCSTK
api to get the current call stack; Another way is use the
QMHSNDPM+QMHRCVPM to get the call stack one level at a time. Does
anybody know which will perform better, or is there another way to
determine if a program is on the current call stack?
----------

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.