public class SmfRecordWriter extends Object implements Closeable
try (SmfRecordWriter writer = SmfRecordWriter.fromName("//DD:OUTPUT"))
{
...
writer.write(smfrecord);
}
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the output dataset or stream.
|
static SmfRecordWriter |
fromDD(String dd)
Create a new SmfRecordWriter to read from an allocated DD.
|
static SmfRecordWriter |
fromName(String name)
Create a new SmfRecordWriter to write to a named file or dataset.
|
static SmfRecordWriter |
fromStream(OutputStream stream)
Create a new SmfRecordWriter to write to an existing stream.
|
void |
write(SmfRecord record) |
public static SmfRecordWriter fromDD(String dd) throws IOException
dd
- The DDNAME for the SMF data file. The DD must be already allocated e.g. via JCL.ZFileException
IOException
public static SmfRecordWriter fromStream(OutputStream stream)
Records written to the stream will include the RDW
stream
- the OutputStream to write records to.public static SmfRecordWriter fromName(String name) throws IOException, FileNotFoundException
"//DD:INPUT"
"//'MVS.DATASET.NAME'" "//'MVS.DATASET.NAME(0)'"
The writer can be automatically closed using a try-with-resources
block (recommended), or call close()
when finished writing.
name
- The name of the resource to open, in one of the formats documented above.IOException
FileNotFoundException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public void write(SmfRecord record) throws IOException
IOException
Copyright © 2020 Black Hill Software Pty Ltd. All rights reserved.