+

Search Tips   |   Advanced Search

RecordOrientedDatasetReaderPattern

The RecordOrientedDatasetReaderPattern pattern is used to read data from a z/OS data set.


Supporting classes


Required properties

The following properties are required for the pattern.

Property name Value Description
PATTERN_IMPL_CLASS Java class name Class that implements the RecordOrientedDatasetReaderPattern interface
DSNAME Dataset name For example, USER216.BATCH.RECORD.OUTPUT


Optional properties

The following properties are optional for the pattern.

Property name Value Description
ds_parameters Parameters used to open the data set. Default for ZFileRecordOrientedDataReader is rb,recfm=fb,type=record,lrecl=80 and Default for ZFileStreamOrientedByteReader and ZFileStreamOrientedTextReader is rt
debug true or false (default is false) Enable detailed tracing on this batch datastream.
EnablePerformanceMeasurement true or false (default is false) Calculates the total time spent in the batch data-streams and the processRecord method, if we are using the GenericXDBatchStep.
EnableDetailedPerformanceMeasurement true or false (default is false) Provides a more detailed breakdown of time spent in each method of the batch data-streams.
file.encoding Encoding of the file. For example, 8859_1.


Interface definition

public interface RecordOrientedDatasetReaderPattern {

	/**
	 * This method is invoked during the job setup phase.
	 * The properties are the ones specified in the xJCL.
	 * @param props
	 */
	public void initialize(Properties props);
	
	/**
	 * This method is invoked only once immediately after
	 * the Zfile is opened. It should be used to process
	 * header information if any.
	 * @param reader
	 * @throws IOException
	 */
	public void processHeader(ZFile reader) throws IOException;
	
	/**
	 * This method should read the next record from the Zfile
	 * and return it in an appropriate form (as an intermediate object)
	 * @param reader
	 * @return
	 * @throws IOException
	 */
	public Object fetchRecord(ZFile reader) throws IOException;
}


xJCL example

<batch-data-streams> 
<bds>
<logical-name>inputStream</logical-name>
<props>
  <prop name="PATTERN_IMPL_CLASS" value="com.ibm.websphere.batch.samples.tests.bds.EchoReader"/>
  <prop name="DSNAME" value="USER216.BATCH.RECORD.INPUT"/>
  <prop name="ds_parameters" value="rt"/>
  <prop name="file.encoding" value="CP1047"/>
  <prop name="debug" value="true"/>
</props>
<impl-class>com.ibm.websphere.batch.devframework.datastreams.patterns.ZFileStreamOrientedByteReader</impl-class>
</bds>
   <bds>
   <logical-name>outputStream</logical-name>
   <props>
    <prop name="PATTERN_IMPL_CLASS" value="com.ibm.websphere.batch.samples.tests.bds.EchoWriter"/>
    <prop name="DSNAME" value="USER216.BATCH.RECORD.OUTPUT"/>
    <prop name="ds_parameters" value="wt"/>
    <prop name="file.encoding" value="CP1047"/>
    <prop name="debug" value="${debug}"/>
    </props>
<impl-class>com.ibm.websphere.batch.devframework.datastreams.patterns.ZFileStreamOrientedByteWriter</impl-class>
</bds>
</batch-data-streams>


Related:

  • Batch data stream framework and patterns
  • Use the batch data stream framework
  • JDBCReaderPattern
  • JDBCWriterPattern
  • ByteReaderPattern
  • ByteWriterPattern
  • FileReaderPattern
  • FileWriterPattern
  • (ZOS) RecordOrientedDataSetWriterPattern
  • JPAReaderPattern
  • JPAWriterPattern