Valid for
Extract
Description
Use RMTBATCH
to specify the name of a remote target file to which Extract writes extracted records. RMTBATCH
is like RMTFILE
in that it specifies the name of a remote target file. However, rather than outputting the data in a Oracle GoldenGate proprietary format, Extract outputs the data to a batch file on the target system. The batch file name is determined by a combination of the target file name and the source file name.
Using this feature, you can transfer the batch file contents a little at a time throughout the day ("trickle" transfer), rather than all at once at the end of the day.
Use wildcards to accommodate different file names with a single RMTBATCH
parameter entry.
RMTBATCH
enables full restart capabilities without loss or repetition of data. This is enabled using Extract checkpoints (GGSCI ADD
EXTRACT
command).
When using direct read functions to transfer batch files with RMTBATCH
, use the following Extract parameters whenever the record length is variable and the source file type is entry-sequenced:
SYSKEYCONVERT USEBYTEPOSITION
POSITIONFIRSTRECORD
With these parameters, Extract can build the target file in all cases, including after a recovery.
If SYSKEYCONVERT
is specified, you cannot mix RMTBATCH
activity with standard extraction of data for replication.
To create OS/390 QSAM files, you can specify certain file creation parameters in a configuration file on the OS/390 platform or using RMTBATCH
.
RMTBATCH
has the following dependencies:
You must include at least one EXTFILE
, EXTTRAIL
, RMTFILE
, RMTTRAIL
, or RMTBATCH
entry in your parameter file.
RMTBATCH
must precede the names of files and tables containing data you want to write to the remote file. Precede the RMTBATCH
entry by a RMTHOST
entry to identify the target computer and TCP/IP port.
Syntax
RMTBATCH destination_file_spec [, PARAMS param [, param, ...]];
Note:
See also the information on RMTBATCH
for QSAM on "RMTBATCH for QSAM".
destination_file_spec
Either a file name, or a file name combined with wildcard characters. The wildcard characters are *
and %.
The name of the source file is substituted for each occurrence of *
in the file specification, and the name of the source subvolume is substituted for each occurrence of %
.
PARAMS
param
param
can be any one of the following:
AUTOTRUNCATE
Executed by Extract or Collector, depending on its placement on the command line.
If AUTOTRUNCATE
is specified before the parameters are defined, Extract deletes the contents of the batch file when it positions to the first record. When you periodically move the same file to the target system, use this parameter to delete previous data from the file.
If AUTOTRUNCATE
is specified after the parameters are defined, Collector deletes the contents of the batch file when it positions to the first record.
BLKSIZE
block_size
Indicates the block size of the source file (default is 4096
). This option is required when the source file is entry-sequenced and its block size is less than 4096
.
CLOSEWIN
minutes
Closes the target file after minutes
of inactivity.
CLOSEACTION
"system_command
"Submits a shell script or system command to the system upon file close, when close was a result of completed processing of the corresponding source file (indicated by a "file close on source" message). Extract waits for the command to complete. To return control to Extract immediately, specify a nowait
type operation in the script or command (as with the &
in UNIX).
FTYPE {E | K | R | U}
Identifies the source file type to the Collector (E
is entry-sequenced, K
is key-sequenced, R
is relative, U
is unstructured). The default is E
, entry-sequenced.
The Collector uses FTYPE
to compute an appropriate record position into the target file (which is always unstructured).
Because keys are identified differently for different file types, this parameter is required if the file type is relative or unstructured.
RECLEN
record_length
Identifies the length in bytes of each record in the target file. Use this to pad records that are shorter than record_length
to a constant length. Records are padded with spaces.
Note:
All RMTBATCH
statements must end with a semicolon (;).
Example
Assume the following configuration:
RMTHOST ggs2, MGRPORT 7809 RMTBATCH /usr/ggsdat/%_*, PARAMS FTYPE E, BLKSIZE 2048, RECLEN 1916; FILE $DATA2.GGS.TL*;
Also assume that a new TL
file is created every day, with the naming convention of TLyymmdd
.
On April 5, 2010, the file $DATA2.GGS.TL100405
is created. On April 6, $DATA2.GGS.TL100406
is created. On the target system, the following files are created, each containing data from the corresponding source file:
/usr/ggsdat/GGS_TL100405 /usr/ggsdat/GGS_TL100406
FTYPE
E
identifies each source file as entry-sequenced; BLKSIZE
specifies the block length of those files as 2048
; and RECLEN 1916
outputs all records as 1916
bytes by padding short records with spaces.
RMTBATCH for QSAM
The following parameters are for QSAM files only:
TARGETFTYPE {QSAMV | QSAMF}
Mandatory parameter for QSAM files. Specify QSAMV for variable-length MVS QSAM files or QSAMF for fixed-length. MVS QSAM files.
TARGETRECLEN
record_length
Mandatory parameter for QSAM files. Specify the length in bytes of a fixed-length record or the maximum length in bytes for variable-length records.record_length
can be from 1
to 32760
.
TARGETBLKSIZE
block_length
Parameter for QSAM files. Specify a multiple of the record length for fixed-length records, or the maximum record length +4 for variable-length records.block_length
can be from 1
to 32760
.
VOLUME
serial_number
[, serial_number
, ...]Mandatory parameter for QSAM files. Identifies the serial numbers of the volumes on which the target data set will reside. Specify up to 255
volume serial numbers.
SPACE
(primary_quantity
, secondary_quantity
, unit
)Mandatory parameter for QSAM files. Requests space for a new data set.
For examples of QSAM parameters, see "QSAM Configuration Parameters".
RMTBATCH and Generation Data Groups
Use RMTBATCH
to create and/or access IBM QSAM Generation data sets within Generation Data Groups (GDG). This feature catalogs successive updates, or generations, of data sets within a GDG. It is typically used on BASE24 Extract and Super Extract output files, but can be used on any entry-sequenced file type.
Generation data sets have sequentially ordered absolute and relative names that represent their age. (Smaller absolute names indicate older data.) A relative name is a signed integer indicating the latest generation (0), next to latest generation (-1), etc. The relative number +1 creates a new generation each time it is used.
Use the following parameters with RMTBATCH
to create or access your generation data sets.
LIKE
Copies the allocation attributes of a model data set to specify the allocation attributes of a new data set. The model data set must be an existing, cataloged data set.
UNIT
Asks the systems to place the data set on a specific device, device type, or group of devices as another data set.
DCBSN (-DCB Model data set)
Names a catalogued data set. Instructs the system to copy data control block information from the data set's label.
To create a generation data set using RMTBATCH:
Create a Generation Data Group index using IDCAMS.
Create an Extract group and parameter file.
Create a RMTBATCH
parameter file as follows:
Specify your GDG file name then a relative number for the GDG file (negative integer, positive integer, or zero)
Add the -P
parameter
Add an Extract as a file type entry.
Example
Sample Extract Parameter File with RMTBATCH
. The remote batch statement is in bold.
EXTRACT EXTTLF1
DISCARDFILE $DATA1.DISCARD.EXTFLT1
SYSKEYCONVERT USEBYTEPOSITION
ALTINPUT OPENTIMEOUT 5, TEMPLATE $DATA01.EXTRACT.P*, USENEXTMODIFIED
POSITIONFIRSTRECORD
RMTHOST OS390, MGRPORT 7809, params "-c ON -P qsamvb.prm"
RMTBATCH file.acct(+1),params ftype u, closewin 2;
File $DATA01.EXTRACT.P*;