WebSphere Extended Deployment Compute Grid, Version 6.1
             Operating Systems: AIX, HP-UX, Linux, Solaris, Windows, z/OS


RecordOrientedDatasetReaderPattern

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

Supporting classes

  • ZFileStreamOrientedTextReader: Reads text data
  • ZFileStreamOrientedByteReader: Reads byte data
  • ZFileRecordOrientedDataReader: Reads sequential data

Required properties

Table 1. Required properties
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

Table 2. Optional properties
Property name Value Description

ds_parameters

Parameters used to open the dataset.

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)

Enables 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 you 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 concepts
[Version 6.1.0.3 and later] Batch data stream framework and patterns
Related tasks
[For z/OS operating system] [Version 6.1.0.3 and later] Using the batch data stream (BDS) framework
Related information
[Version 6.1.0.3 and later] JDBCReaderPattern
[Version 6.1.0.3 and later] JDBCWriterPattern
[For z/OS operating system] [Version 6.1.0.3 and later] ByteReaderPattern
[Version 6.1.0.3 and later] ByteWriterPattern
[Version 6.1.0.3 and later] FileReaderPattern
[Version 6.1.0.3 and later] FileWriterPattern
[For z/OS operating system] [Version 6.1.0.3 and later] RecordOrientedDataSetWriterPattern
[Version 6.1.0.5 and later] JPAReaderPattern
[Version 6.1.0.5 and later] JPAWriterPattern
Reference topic    

Terms of Use | Feedback

Last updated: Oct 30, 2009 6:22:31 PM EDT
http://publib.boulder.ibm.com/infocenter/wxdinfo/v6r1/index.jsp?topic=/com.ibm.websphere.gridmgr.doc/info/scheduler/rbtchpttrn7.html