RecordOrientedDataSetWriterPattern

RecordOrientedDataSetWriterPattern 模式用于将数据写入 z/OS® 数据集。

支持类

  • ZFileStreamOrientedTextWriter:写入文本数据
  • ZFileStreamOrientedByteWriter:写入字节数据
  • ZFileRecordOrientedDataWriter:写入序列数据

必需属性

以下属性对于该模式是必需的。

表 1. 必需属性. 该表包含此模式的每个必需属性的名称、值和描述。
属性名称 描述
PATTERN_IMPL_CLASS Java™ 类名 实现 RecordOrientedDatasetWriterPattern 接口的类
DSNAME 数据集名称 例如,USER216.BATCH.RECORD.OUTPUT

可选属性

以下属性对于该模式是可选的。

表 2. 可选属性. 该表包含此模式的每个可选属性的名称、值和描述。
属性名称 描述
ds_parameters 用于打开数据集的参数。 ZFileRecordOrientedDataWriter 的缺省值为 wb,recfm=fb,type=record,lrecl=80,且

ZFileStreamOrientedByteWriter

和 ZFileStreamOrientedTextWriter 的缺省值为 wt
debug true 或 false(缺省值为 false) 在此批处理数据流上启用详细跟踪。
EnablePerformanceMeasurement true 或 false(缺省值为 false) 如果正使用 GenericXDBatchStep,那么计算批处理数据流和 processRecord 方法中所花的总时间。
EnableDetailedPerformanceMeasurement true 或 false(缺省值为 false) 提供在批处理数据流的每个方法中花费的更为详细的时间细目。
file.encoding 文件的编码。 例如,CP1047

接口定义

/**
 * 
 * This pattern is used to write data to z/OS dataset using
 * jzos apis
 */
public interface RecordOrientedDatasetWriterPattern {

	/**
	 	 * This method is called during the job setup phase allowing
	 	 * the user to do initialization.
	 	 * The properties are the ones passed in the xJCL
	 	 * @param props
	 */
	public void initialize(Properties props);
	
	/**
	 	 * This method should be used to write the given
	 	 * object into the dataset
	 	 * @param out  
	 	 * @param record  
	 	 * @throws IOException
	 */
		public void writeRecord(ZFile out, Object record) throws IOException;
	
	/**
	 	 * This method should be used to write header information
	 	 * if any
	 	 * @param out  
	 	 * @throws IOException
	 */
		public void writeHeader(ZFile out) throws IOException;
	
	/**
	 	 * This method can be optionally called during process step to explicity 
	 	 * initialize and write the header. 
	 	 * @param header
	 */
		public void writeHeader(ZFile out, Object header);
	
}

xJCL 示例

<batch-data-streams>
	 <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>

指示主题类型的图标 参考主题



时间戳记图标 最近一次更新时间: last_date
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=rgrid_btchpttrn8
文件名:rgrid_btchpttrn8.html