return value of flocate() method

General discussion on the JZOS batch launcher and toolkit
Post Reply
gakunkel
Posts: 1
Joined: Thu Feb 02, 2006 1:04 pm

return value of flocate() method

Post by gakunkel »

I noticed in the ZFile class that the native flocate() method returns void. However, the z/OS C/C++ Library Reference indicates that the flocate() method returns an int value to indicate the success/failure of the search (zero if successful, EOF if not). Is this a discrepancy or am I reading something wrong?

It would be nice if I could check a return value of my locate before trying to do a read(). A read() with an invalid locate seems to cause an abend.

There are, of course, ways of getting around this (use locate GE instead of EQ), but I was just wondering why the difference in the method definition.

Thanks.
coz
Posts: 391
Joined: Fri Jul 30, 2004 5:29 pm

Post by coz »

You're right - this should be changed. We'll correct in the upcoming release.

BTW, we are currently throwing an RCException on non-zero. You should be able to catch this and handle for now.
Post Reply