D37 Abend in ZFile writing to a PDS that is out of space

General discussion on the JZOS batch launcher and toolkit
Post Reply
gregt
Posts: 2
Joined: Fri Mar 05, 2010 1:27 pm

D37 Abend in ZFile writing to a PDS that is out of space

Post by gregt »

Hi there,

We're receiving a D37 abend when attempting to use ZFile to write a member in an existing partioned data set (PDS) that has no available space:

CEE3250C The system or user abend SD37 R=00000004 was ssued. From entry point ZFileImpl::close() at compile unit offset +0000000079D

Below is a small sniplet of the code that writes to this PDS. I've inserted debug statements and determined the abend occurs when the zFile.close() method is called. In addition, the code works properly when the PDS has available space.

String zJCLMember = ZFile.getSlashSlashQuotedDSN(jclDSName + "(" + dataSetMember + ")", true);
try {
zFile = new ZFile(zJCLMember, "wt,noseek,lrecl=80,"recfm=FB");
}
catch(ZFileException e){
// handle the error...
}
catch(RuntimeException e) {
// handle the error...
}

String enc = ZUtil.getDefaultPlatformEncoding();
try {
StringBuffer is = swriter.getBuffer();
BufferedReader in = new BufferedReader(new StringReader(is.toString()));
OutputStream os = zFile.getOutputStream();
BufferedWriter wtr = new BufferedWriter(new OutputStreamWriter(os, enc));
String outline;
while ((outline = in.readLine()) != null) {
wtr.write(outline);
wtr.newLine();
}
wtr.flush();
}
catch(ZFileException e){
// handle the error...
}
catch(Exception e) {
// handle the error...
}
finally {
try {
if (zFile != null) {
zFile.close();
}
}
catch(Exception e) {
// handle the error...
}
}

Shouldn't this type of error produce a ZFileException instead of a D37 abend?

Thanks for any assistance you can offer.

Greg Terwilliger
IBM SMPE Development
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

Yes, it would be nice...

ZFile is a wrapper around the C Library, and there is a known problem with the C library in that some abends (such as this D37) are not handled by the C library. My understanding is that some of these are not even "retryable".

I suggest that you open a problem against the z/OS C library to see if this abend is one that they should have surfaced as an C I/O error rather than abending.
gregt
Posts: 2
Joined: Fri Mar 05, 2010 1:27 pm

Post by gregt »

Ok, thanks. So it sounds like there are a number of error conditions that could result in an abend instead of a C I/O error. Are you familiar with what these are? We were hoping to use ZFile to write a member in a PDS but may need to reevaulate it's use if the underlying C functions do not handle these types of errors.
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

These should be documented in the z/OS C/C++ Programmers Guide.
Post Reply