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 - 4043 days ago
Last viewed on: 18 Apr 2024 (5630 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: 11 years 25 days 16 hours 30 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: 11 years 25 days 14 hours 26 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: 11 years 25 days 14 hours 24 minutes ago

Excellent, sir.