REMAP - connect_cdc_sqdata - Latest

Connect CDC (SQData) Apply engine

Product type
Software
Portfolio
Integrate
Product family
Connect
Product
Connect > Connect CDC (SQData)
Version
Latest
Language
English
Product name
Connect CDC (SQData)
Title
Connect CDC (SQData) Apply engine
Copyright
2024
First publish date
2000
ft:lastEdition
2024-07-30
ft:lastPublication
2024-07-30T20:19:56.898694

Remap numerous bytes to a given record layout. It is common for z/OS IMS and VSAM based applications to reuse previously defined Segments and Records in order to avoid creating new physical segments and files. That practice dates back to the dawn of computers when storage costs were astronomical by comparison to today. It was made possible by the fact that the database management systems did not contain catalogs describing the detailed content of Segments or Records down to the level of individual elementary data items such as a NAME or PHONE-NUMBER. Rather the DBMS merely knew where the physical segment or record could be found and how long it was. While an overly simplistic explanation it is the fundamental premise behind the need for the REMAP function.

Category

Record

Syntax
REMAP(<source_datastore>, <remapped_description_alias>, <cdc_after_image> [,<cdc_before_image>)
or
REMAP(<source_datastore>, <remapped_description_alias> | variable | field, <cdc_after_image[,<cdc_before_image>])
Parameters and Descriptions
Parameter Description
source_datastore The alias name of the source DATASTORE.
remapped_description_alias The alias name of the DESCRIPTION that the source data will be mapped into from the Source DATASTORE.
cdc_after_image The raw image of CDC record in the format associated with Source DATASTORE. It will be the after image for inserts and updates and the before image for deletes.
cdc_before_image The raw image of CDC record in the format associated with Source DATASTORE. It will be the before image of an update.
Note: The GET_RAW_RECORD Function is used to populate the cdc_after_image and cdc_before_image parameters used by REMAP.

Example 1

An Segment maintained by an IMS application maintains two versions of the same segment both of which will be replicated into a new RDBMS. Variations in the source data that exist from an acquisitions will be eliminated in the new data model.

First identify the field in the Source COBOL description that identifies which COBOL copybook should be used for a captured IMS Segment. The field will exist in both copybooks at the same displacement and for the same length but may have different field-names. Application SME have explained that there are two versions of this Segment, one for USA based employees and a second for those in the EU. The IMS DBD HREMPLDB identifies the segment using its original name, HREMP001 prior to expansion into the EU. They tell us that the HR-EMPLOYEE-BASE PIC X(2) field will contain either "US" or "EU". With that information and the two COBOL copybooks named HRUSEMPL (the original was renamed from HREMP001) and HREUEMPL the following logic will be used to select which DESCRIPTION to use and which of two Mapping PROCS will be used to populate the Relational Target.

The Apply Engine script contains the following DESCRIPTIONS and section of the script and a portion of each PROC contain the following instructions:
DESCRIPTION COBOL ./IMSSEG/HREMPLDB/HRUSEMPL.cob AS HREMP001
                 FOR SEGMENT HREMP001
                 IN DATABASE HREMPLDB;
-- HREUEMPL redefines the HREMP001 segment
DESCRIPTION COBOL ./IMSSEG/HREMPLDB/HREUEMPL.cob AS HREUEMPL
                 FOR SEGMENT HREMP001
                 IN DATABASE HREMPLDB;    
CASE IMSSEGNAME(CDCIN)
WHEN HREMP001
{
   if HREMP001.HR-EMPLOYEE-BASE = 'US"
       {  CALLPROC(M_HRUSEMPL)  APPLY(TARGET,T_HRUSEMPL) }
   else
       {  CALLPROC(M_HREUEMPL)  APPLY(TARGET,T_HREUEMPL) }
}
....
CREATE PROC M_HRUSEMPL AS SELECT
{
   ...
--  Since the CDC record is automatically read into the DESCRIPTION with the matching Segment Name as its alias the data can be mapped without further instructions.
   T_EMPLOYEE.EMPLOYEE_NAME     = HREMP001.HRUS-EMPLOYEE-NAME
   ...
CREATE PROC M_HREUEMPL AS SELECT
{
   REMAP(CDCIN, HREUEMPL, GET_RAW_RECORD(CDCIN, AFTER), GET_RAW_RECORD(CDCIN, BEFORE))
   ...
   T_EMPLOYEE.EMPLOYEE_NAME     = HREUEMPL.HREU-EMPLOYEE-NAME
   ...
Note: It is recommended that the first DESCRIPTION for the Segment VSAM file use the actual Segment name from the IMS DBD SEGM statement as its ALIAS name, in this example HREMP001. Subsequent DESCRIPTIONS may use any AS <alias_name> because the IMSEGNAME function is used to identify the Segment in the CDC data captured and published to this Engine, not the AS <alias_name>.

Example 2

A VSAM file maintained by a CICS program maintains two versions of the same record both of which will be replicated into a new RDBMS. Variations in the source data that exist from an acquisitions will be eliminated in the new data model.

First identify the field in the Source COBOL description that identifies which COBOL copybook should be used for a captured VSAM record. The field will exist in both copybooks at the same displacement and for the same length but may have different field-names. Application SME have explained that there are two versions of this record, one for USA based employees and a second for those in the EU. The original CICS application identified the Record in the CICS FCT (file control table) by the name EMPLOYEE prior to expansion into the EU. They tell us that the HR-EMPLOYEE-BASE PIC X(2) field will contain either "US" or "EU". With that information and the two COBOL copybooks named HRUSEMPL (the original was renamed from EMPLOYEE) and HREUEMPL the following logic will be used to select which DESCRIPTION to use and which of two Mapping PROCS will be used to populate the Relational Target.

The Apply Engine script contains the following DESCRIPTIONS and section of the script and a portion of each PROC contain the following instructions:
DESCRIPTION COBOL ./COBOL/HRUSEMPL.cob AS EMPLOYEE;
-- HREUEMPL redefines the EMPLOYEE record
DESCRIPTION COBOL ./COBOL/HREUEMPL.cob AS HREUEMPL;
CASE RECNAME(CDCIN)
WHEN EMPLOYEE
{
   if EMPLOYEE.HR-EMPLOYEE-BASE = 'US"
       {  CALLPROC(M_HRUSEMPL)  APPLY(TARGET,T_HRUSEMPL) }
   else
       {  CALLPROC(M_HREUEMPL)  APPLY(TARGET,T_HREUEMPL) }
}
....
CREATE PROC M_HRUSEMPL AS SELECT
{
   ...
--  Since the CDC record is automatically read into the DESCRIPTION with the matching CICS FCT Record Name as its alias the data can be mapped without further instructions.
   T_EMPLOYEE.EMPLOYEE_NAME     = EMPLOYEE.HRUS-EMPLOYEE-NAME
   ...
CREATE PROC M_HREUEMPL AS SELECT
{
   REMAP(CDCIN, HREUEMPL, GET_RAW_RECORD(CDCIN, AFTER), GET_RAW_RECORD(CDCIN, BEFORE))
   ...
   T_EMPLOYEE.EMPLOYEE_NAME     = HREUEMPL.HREU-EMPLOYEE-NAME
Note: It is critical that the first of one or more record DESCRIPTIONS for the VSAM file use the actual VSAM FCT Name as its ALIAS name, in this example EMPLOYEE. Subsequent DESCRIPTIONS may use any AS <alias_name> as long as it does not match any of the actual FCT file names captured and published to this Engine.