Please enable JavaScript to view this site.

The RECNAME function returns the alias of the DESCRIPTION corresponding to the current record from the source datastore.

Category

Change Data Capture

Syntax

RECNAME(<source_datastore>)

 

Parameter Descriptions

source_datastore  -  The alias name of the source datastore, often CDCIN, that contains CDC records.

Example 1

Check the name of the table in the CDC records for ORG_EMPLOYEE and ORG_DEPARTMENT tables and call the appropriate mapping procedure.

 

DESCRIPTION DB2SQL ./DB2DDL/EMPLOYEE.ddl  AS EMP;

DESCRIPTION DB2SQL ./DB2DDL/DEPARTMENT.ddl  AS DEPT;

 

PROCESS INTO TARGET_DS

SELECT

{

   CASE

   WHEN RECNAME(CDCIN) = 'EMP'

       CALLPROC(P_MAP_EMPLOYEE

   WHEN RECNAME(CDCIN) =  'DEPT'

       CALLPROC(P_MAP_DEPARTMENT)

}

FROM CDCIN;

 

Example 2

Check the name of the IMS segments in the HREMPLDB database CDC records and call the appropriate mapping procedure.

 

DESCRIPTION COBOL ./IMSSEG/EMPLDETl.cob  AS EMPLOYEE

                FOR SEGMENT EMPLDETl

                IN DATABASE HREMPLDB;

DESCRIPTION COBOL ./IMSSEG/EMPAREV1.cob AS REVIEW

                FOR SEGMENT EMPAREV1

                IN DATABASE HREMPLDB;

 

PROCESS INTO TARGET_DS

SELECT

{

   CASE

   WHEN RECNAME(CDCIN) = 'EMPLOYEE'

       CALLPROC(P_MAP_EMPLOYEE

   WHEN RECNAME(CDCIN) =  'REVIEW'

       CALLPROC(P_MAP_REVIEW)

}

FROM CDCIN;

 

Example 3

Check the name of the VSAM File in the CDC records from the VSAM Log capture or the Keyed File Compare capture and call the appropriate mapping procedure.

 

DESCRIPTION COBOL ./FILE/EMPLDETl.cob AS EMPLOYEE;

DESCRIPTION COBOL ./FILE/EMPAREV1.cob AS REVIEW;

 

PROCESS INTO TARGET_DS

SELECT

{

   CASE

   WHEN RECNAME(CDCIN) = 'EMPLOYEE'

       CALLPROC(P_MAP_EMPLOYEE

   WHEN RECNAME(CDCIN) =  'REVIEW'

       CALLPROC(P_MAP_REVIEW)

}

FROM CDCIN;

 

Note, the DESCRIPTION alias MUST match the VSAMDD or short system name for VSAM files defined in CICS or the RECALIAS runtime parm from the Keyed File compare capture. In our example the VSAM files are EMPLOYEE and REVIEW.