|
Scott, I have a service program that is processing various types of data input and returning a formatted string. If the procedure being called encounters an error, I send back a return code to the caller. I am enhancing that to send a message to QHIST and the users job log. One of the parms I am passing to my generic logging routine is the name of the procedure the error occured in. Currently, I am hard coding it, but would like to be able to have a variable that I can pass instead. This way, if I clone one of the procedures, I do not have to remember to change the name in the error handling code. Thanks, Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx> wrote: > In a Sub-procdeure, is there any way to get the name of the procedure > being executed? The subprocedure name is in the callstack. You can use an API to get retrieve the call stack entries, or you can send a message to yourself and see who it came from :) Neither of these are ideal or perform particularly well. What are you trying to accomplish? Maybe I'd have some better suggestions if I knew the business problem you were trying to solve...
As an Amazon Associate we earn from qualifying purchases.
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.