LBurkett99
800 pts. | May 20 2009 9:13PM GMT
Thanks, Wilson. I tried it your way with the same result.
My error code structure differs from your suggestion in two ways. My initial value for ApiErrSiz is zero instead of 264, because I wanted exceptions returned to the program and use Monitor to deal with them, and ApiErrTxt is a pointer instead of a 256 byte field.
Thanks for the response.
Leo Burkett
WilsonAlano
2005 pts. | May 21 2009 2:19PM GMT
Hi Leo,
You can’t pass a pointer instead of ApiErrTxt. In manual IBM put an (*) in OPM APIs just to indicate that the field is a variable length field so it can’t be a pointer.
Wilson
LBurkett99
800 pts. | May 21 2009 9:15PM GMT
Wilson,
I went thru it again, just to be sure, using your error code data structure, and I still get CPF3CF1. I am at V5R4. Could this make a difference?
The description of the error code on the Information Center web site defines two error code structures, a short one like you described and I am using, and a longer one, and implies that the error code structure to use is dependant on the API. Am I reading this right? Does QSYGETPH use the longer error code?
Thanks again for your help
Bvining
4885 pts. | May 22 2009 3:50PM GMT
Using a stand-alone 10i 0 field, initialized to 0, should work fine for the error code. I don’t understand your reference to ApiErrTxt being a pointer, as an ApiErrSiz of 0 means there is no ApiErrTxt (or any other fields for that matter — you are providing 0 bytes for the error code structure after all…).
Please return to using the stand-alone field (since you want exceptions) and try the API call again. If you are still getting the CPF3CF1 then make sure that you are passing ApiErrSiz as the 4th parameter when calling QSYGETPH. If still having a problem then please post your actual D specs and Call statement to QSYGETPH as “something funny” is going on.
Bruce
Bruce Vining Services
WilsonAlano
2005 pts. | May 22 2009 5:41PM GMT
Hi,
Thinking about what Bruce Vining posted and it’s true. An integer stand alone field must be enough and the call and D specs (as Bruce said) may be your problem). V5R4 is not the problem!
Regards,
Wilson
LBurkett99
800 pts. | May 22 2009 9:33PM GMT
Thank you both for your help. Wilson, you told me that my interpretation of “CHAR(*)” to mean a pointer was incorrect, and Bruce, your suggestiuon I check parameter 4 caused me to take a closer look at my parameter string. Sure enough, there were other parameters in the call which I have mistakenly coded as pointers instead of field names. Once I correct ed them, the API ran with no problems.
Thanks again to you both.
Leo Burkett






