RecordOrientedDatasetReaderPattern
RecordOrientedDatasetReaderPattern パターンは、z/OS® データ・セットからデータを読み取るために使用されます。
サポートされるクラス
- ZFileStreamOrientedTextReader: テキスト・データを読み取ります
- ZFileStreamOrientedByteReader: バイト・データを読み取ります
- ZFileRecordOrientedDataReader: 順次データを読み取ります
必須プロパティー
以下は、このパターンの必須のプロパティーです。
プロパティー名 | 値 | 説明 |
---|---|---|
PATTERN_IMPL_CLASS | Java™ クラス名 | RecordOrientedDatasetReaderPattern インターフェースを実装するクラス |
DSNAME | データ・セット名 | 例えば、USER216.BATCH.RECORD.OUTPUT です。 |
オプション・プロパティー
以下は、このパターンのオプションのプロパティーです。
プロパティー名 | 値 | 説明 |
---|---|---|
ds_parameters | データ・セットを開くために使用されるパラメーター。 | ZFileRecordOrientedDataReader のデフォルトは rb,recfm=fb,type=record,lrecl=80 であり、ZFileStreamOrientedByteReader および ZFileStreamOrientedTextReader のデフォルトは rt です。 |
debug | true または false (デフォルトは false) | このバッチ・データ・ストリームに対する詳細トレースを使用可能にします。 |
EnablePerformanceMeasurement | true または false (デフォルトは false) | GenericXDBatchStep を使用している場合に、バッチ・データ・ストリームおよび processRecord メソッドに費やされた合計時間を計算します。 |
EnableDetailedPerformanceMeasurement | true または false (デフォルトは false) | バッチ・データ・ストリームの各メソッドで費やされた時間のより詳細な明細を提供します。 |
file.encoding | ファイルのエンコード。 | 例えば、8859_1 です。 |
インターフェース定義
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 の例
<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>