| View previous topic :: View next topic |
| Author |
Message |
gregt
Joined: 05 Mar 2010 Posts: 2
|
Posted: Fri Mar 05, 2010 3:20 pm Post subject: D37 Abend in ZFile writing to a PDS that is out of space |
|
|
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 |
|
| Back to top |
|
 |
dovetail Site Admin
Joined: 29 Jul 2004 Posts: 878
|
Posted: Fri Mar 05, 2010 3:34 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
gregt
Joined: 05 Mar 2010 Posts: 2
|
Posted: Mon Mar 08, 2010 11:56 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
dovetail Site Admin
Joined: 29 Jul 2004 Posts: 878
|
Posted: Mon Mar 08, 2010 12:18 pm Post subject: |
|
|
| These should be documented in the z/OS C/C++ Programmers Guide. |
|
| Back to top |
|
 |
|