Please enable JavaScript to view this site.

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. Please refer to the IDENT command for more information.

Category

Specialized

Syntax

RECIDENT(<datastore>)

 

Parameter Descriptions

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).

Note:  While there will generally be one field at a common offset in the source datastore that identifies the record type source field, there may be lower level references to different fields for each record type as in the example below.

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.

Check the field identifier of the record within the source datastore.  If a company record has been read, call the mapping procedure P_MAP_COMPANY_RCD.  If a vendor record has been read, call the mapping procedure P_MAP_VENDOR_RCD.

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;