I have spent hours looking for an answer to what I am doing wrong with no luck. Probably searching wrong.

I have created a test program that receives two 10 byte char fields, and in the procedure returns a 20 byte field that concatenates the two input fields together (original huh). I have tested on the iSeries and it works as designed.

When I run this in debug I get into the program on the iSeries, see both input variables, see the combining of the values and show that I return it (saw this debugging in an iSeries program as well). At this point though I see the error "Pointer not set for location referenced. " in the XTOOLKIT job that is running under my profile.

The documentation shows that the 4th parm for the PgmCall function is the return value. I have tried to put a variable in this rather than NULL both as an array, and just a variable with no luck either.

Hope someone has seen this before. One of the things about the Toolkit that has exited me was the ability to call functions and receive back values other than integers.

Thank you so much Alan. Applying the PTF's solved the problem. I had the correct process at some point as to getting the information from the return but it was not working due to the version of the toolkit being used.

With that said I also worked with your article and very well done and excellent boilerplate for our future use. Thanks for all you do for the IBM i community.

One more item on this. My first test was with a single char field being returned and this had no problems. Documentation says I can return a DS. My procedure returns the contents of a files entire record format. Of course has many fields some of which are packed. When I get the data back I see not errors on the call but get no data back. How should this be handled.