Modifying Richard Ecuyer's example from February 2006:
c Eval pm_counter=1
c movel 'QDBUDR ' Pm_CSEntry
and then, if the first QMHSNDPM call fails with CPF2479, calling it
c movel 'QDBPUT ' Pm_CSEntry
I get the name of the program that immediately tripped the trigger.
I noticed a lag in the response time, so to determine whether it was in
the API calls or in the DSPLY statement, I added a couple of timestamps,
one before the first QMHSNDPM call, and one after the QMHRCVPM call,
DSPLYing them both just before the final DSPLY with my result, and found
that the API calls only took 2-4 milliseconds on a "slim" 170 running
V4R4, so I guess I'm OK on time.
But can anybody think of a case (or an OS release) where climbing one
call stack level beyond the QDBUDR/QDBPUT call might fail to return the
right program? Or explain why Ecuyer's example just climbed a straight 5
call stack levels, overshooting the target by 2 levels?