I had hoped to be able to retrieve the QUERYNO immediately after I had executed the SELECT, FETCH, etc so that I would know what statement I had just executed if I got a negative sqlcode and abended my program. Your suggestion would only give me a list of all the SQL statements I had in the program not which one I just executed.
thanks
jeff