The RECIDENT function can be used, when there are multiple record types within a source datastore, to identify the specific record being processed. This allows you to control the processing of various record types within the source datatore. This function returns the value of the record identifier field that was defined with a corresponding IDENT command. These identifier fields can be different source fields. The IDENT command makes this transparent to the RECIDENT function.
Category
Specialized
Syntax
RECIDENT(<datastore>)
Parameter and Description
Parameter | Description |
---|---|
datastore | This parameter specifies the name of the source datastore containing the multiple record types. |
Example
Given a source datastore (INPUT_DS) that contains two (2) record types (Company and Vendor).
The IDENT commands specify that when source field SRC_ID_FLDA = 'C', a Company record has been read. When SRC_ID_FLDx = 'V', a Vendor record has been read.
IDENT INPUT_DS.src_id_fielda 'C';
IDENT INPUT_DS.src_id_fieldb 'V';
PROCESS INTO OUTPUT_DS
SELECT
{
CASE
WHEN RECIDENT(INPUT_DS) = 'C'
CALLPROC(P_MAP_COMPANY_RCD)
WHEN RECIDENT(INPUT_DS) = 'V'
CALLPROC(P_MAP_VENDOR_RCD)
}
FROM CDCIN;