Midrange News for the IBM i Community


Posted by: Bob Cozzi
Rogue Programmer
Cozzi Productions, Inc.
Chicagoland
Find my Caller PGM name
has no ratings.
Published: 24 Mar 2013
Revised: 25 Mar 2013 - 1705 days ago
Last viewed on: 24 Nov 2017 (3183 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Find my Caller PGM name Published by: Bob Cozzi on 24 Mar 2013 view comments(3)

I've switched from using the Get Call Stack API to using the classic Snd/Rcv message APIs for my getCallerPgmName() function in COZTOOLS.

I had to switch because I was finding that the callstack API wasn't always returning a value--or in some cases was returning blanks. This was observed during web/CGI program processing. Normally this can be expected if the pgm was recreated or is locked by a SAVxxx command; but I'm being told that is not the case here.

The only shortcoming to using the Snd/Rcv msg APIs is that you don't get the library name of the caller, which is returned by the callstack API.

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: Ringer
Premium member *
Comment on: Find my Caller PGM name
Posted: 4 years 8 months 1 days 2 hours 43 minutes ago

Does your classic way work across activation group boundaries? Just asking.

Chris Ringer

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Find my Caller PGM name
Posted: 4 years 8 months 1 days 40 minutes ago

Yes. Even the other way (calling the API) would work across A/G groups.

Posted by: Ringer
Premium member *
Comment on: Find my Caller PGM name
Posted: 4 years 8 months 1 days 38 minutes ago

Excellent, sir.