ZFileException (fopen failed)

General discussion on the JZOS batch launcher and toolkit
Post Reply
bilbozos
Posts: 18
Joined: Wed Jan 18, 2006 5:53 am

ZFileException (fopen failed)

Post by bilbozos »

Hi List!

I'm trying to open a MVS dataset using JZOS, but the following error occurs:

Code: Select all

com.dovetail.jzos.ZFileException: //WEBDES.T.MYFILE: fopen failed - EDC5049I The specified file name could not be located. ERRNO=49 ERRNO2=0x594003d LAST_OP=50 ABEND_CODE=0x2 ABEND_RC=5896
	at com.dovetail.jzos.ZFile.fopen(Native Method)
	at com.dovetail.jzos.ZFile.<init>(ZFile.java:188)
	...
The dataset exists, and I can browse its content from within the ISPF panels. Another Java program using IBM's JRIO API has no problem in opening it.

My questions:

(1) I searched the z/OS C/C++ Library Reference and z/OS C/C++ Programming Guide for the meaning of all those ERRNO, ERRNO2, etc. return codes, but I didn't find them. Where exactly can I find the meaning of all those return codes?

(2) The Javadoc of ZFile class talks about the JzosPermission 'zfile.all'. Where can I find more deep info about that if that's the way to the solution of my error?

Any hint would be highly appreciated.

Thanks in advance.[/b]
coz
Posts: 391
Joined: Fri Jul 30, 2004 5:29 pm

Post by coz »

1.) You can look up the errno2 (errnojr) values in the Unix System Services messages and codes document. Here's a link the the R1.7 USS guides:

http://www-03.ibm.com/servers/eserver/z ... f/uss.html

When there, look for the chapter "Reason Codes (Errnojrs) Listed by Value". Using the last 4 digits of the errno2 value you should be able to look up the reason. In your case, 0x003D means:

JRDirNotFound
A directory in the pathname was not found.
Action: One of the directories specified was not found. Verify that the name specified is spelled correctly.

In the C++ programming guide chapter 10, there is a discussion about how filenames are interpreted by the fopen() call. In your case, //WEBDES.T.MYFILE will have a high level qualifier added to the DSN. If this name is already fully qualified, you should indicate that to fopen() by supplying: //'WEBDES.T.MYFILE'.

(See the javadoc for ZFile for a set of examples that might be helpful)

2.) The permission zfile.all is relevant only if you are running under a java security manager (you probably aren't). This permission must be set in a policy in order to use ZFile at all. You would see a different exception (SecurityException) if this were the problem.

Hope this helps.
bilbozos
Posts: 18
Joined: Wed Jan 18, 2006 5:53 am

ZFileException (fopen failed) - solved

Post by bilbozos »

Yes, the datasets that my application tries to open are already fully qualified datasets. I was previously using IBM's JRIO package, which didn't require the single quotes, and that mislead me. Your suggestion was straight.

Thank you very much for the detailed information.
Post Reply