JZOS and opening RRDS files

General discussion on the JZOS batch launcher and toolkit
Post Reply
medved
Posts: 4
Joined: Tue Sep 29, 2015 10:57 am

JZOS and opening RRDS files

Post by medved »

I used the example program for copying in the toolkit to open some VSAM files.
But if the file is a RRDS type of file, it fails.

The code is:
String sourceDD = ZFile.allocDummyDDName();
ZFile.bpxwdyn("alloc fi(" + sourceDD + ") da(" + sourceDSN
+ ") reuse shr msg(wtp)");


If sourceDSN is a valid ESDS or KSDS file, it works fine. If it is RRDS I get:

Exception in thread "main" com.ibm.jzos.ZFileException: //DD:SYS00010: fopen() failed; EDC5041I An error was detected at the system l
evel when opening a file.; errno=41 errno2=0xc00a0022 last_op=100 errorCode=0x800a0
at com.ibm.jzos.ZFile.fopen(Native Method)
at com.ibm.jzos.ZFile.doZFileOpen(ZFile.java:613)
at com.ibm.jzos.ZFile.<init>(ZFile.java:476)

Any ideas why?

Thanks
Pat
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: JZOS and opening RRDS files

Post by dovetail »

Your post did not include the ZFile constructor, so I can't see what options you used.
The failure you are getting is in the C/C++ library fopen() routine. The manuals will help you figure out what the error is.
medved
Posts: 4
Joined: Tue Sep 29, 2015 10:57 am

Re: JZOS and opening RRDS files

Post by medved »

I left out:

ZFile.bpxwdyn("alloc dd(" + ddname + ") dsn(" + filename + ") reuse shr");

I also tried:
ZFile.bpxwdyn("alloc fi(" + sourceDD + ") da(" + sourceDSN + ") reuse shr msg(wtp)");


I could not find any of those error codes in the IBM docs.
errno=41 is just Fopen() failed as we see in the message.
errno2=0xc00a0022
In the IBM docs for errno2,
(http://www-01.ibm.com/support/knowledge ... llerr2.htm)
I see errors of:
.
.
C0090030
C00B0001
C00B0002
.
.

Skips over C00A0022


I'll keep looking for it elsewhere, but that is where I have looked so far.

Thanks,
Pat
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: JZOS and opening RRDS files

Post by dovetail »

Your exception is not occurring in the ZFile.bpxwdyn() static method.

Your exception is occurring in the ZFile fopen() method, which is invoked by the ZFile constructor.
What arguments are you passing to the constructor?
Have you looked at the RRDS example in the "z/OS C/C++ Programming guide" ?

I can't say why errno2=0xc00a0022 is not documented by IBM - you would have to ask them :-)

The best reference is "z/OS C/C++ Programming Guide" - Ch 18: Debugging I/O Programs.
In there, you are directed to look at last_op. 100 is "__VSAM_OPEN_FAIL" .
The errorCode=0x800a0 is the amrc __feedback structure. (__rc=8, __fdbk=A0).


https://www-01.ibm.com/support/knowledg ... 0/x1cb.htm

160(X'A0') The operands specified in the ACB or GENCB macro are inconsistent either with each other or with the information in the catalog record.


I suspect that you are trying to open the RRDS using a mode argument to fopen() that implies sequential processing.
medved
Posts: 4
Joined: Tue Sep 29, 2015 10:57 am

Re: JZOS and opening RRDS files

Post by medved »

Thanks,

I should have put in:

ZFile myFile = new ZFile("//DD:" + ddname, "rb,type=record,noseek")

This is where I get the failure not the BPXWDYN.
I tried without noseek as well.

I did the exact same thing for ESDS and KSDS and it worked.
I am only trying to read thus rb.

Pat
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: JZOS and opening RRDS files

Post by dovetail »

noseek doesn't make sense for an RRDS, but you said you tried without that.

I haven't tried RRDS with just "rb,type=record", only "rb+,type=record" and "ab+,type=record" (both read and write). Does that work?

Your error is coming from fopen() in the C library and not JZOS per se. I would open an ETR with IBM.
medved
Posts: 4
Joined: Tue Sep 29, 2015 10:57 am

Re: JZOS and opening RRDS files

Post by medved »

Thank you very much.

I can open the file the file with rb+. I am not sure why I need the write access.

The read fails.

nRead = zFileIn.read(recBuf);


nRead is -1 for RRDS only.

I would assume I can do reads even though it required me to have the + for updates.
I have read you can do sequential reads for RRDS and don't have to specify a record even though you can.


Thanks,
Pat
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: JZOS and opening RRDS files

Post by dovetail »

ZFile.read() = -1 means an EOF was encountered.
I would assume that this is because the mode that you are using positions to the end after open.
Post Reply