CALLPROC - 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
Last updated
2024-12-13
Published on
2024-12-13T13:15:51.808737

The CALLPROC function invokes a predefined Procedure (PROC) within an Apply Engine script. No parameters are passed by CALLPROC to and from the Procedure. The Procedure has access to data associated with all DATASTORES, DESCRIPTIONS, and DECLAREed Variables back and forth.

Category

Specialized

Syntax
CALLPROC(proc_name)
Parameter and Description
Parameter Description
proc_name The name of a mapping procedure (PROC) that was previously created using the CREATE PROC command.

Example

Assume that there are two (2) PROCs that contain different mapping logic based on the contents of a status (STATUS) in the source datastore records. These PROCs are defined as follows:
CREATE PROC MAP_CASE1 AS SELECT
{
   TARGET_FIELD1 = SOURCE_FIELD1
   TARGET_FIELD2 = SOURCE_FIELD2
}
FROM <source_datastore>;

CREATE PROC MAP_CASE2 AS SELECT
{
   TARGET_FIELD1 = SOURCE_FIELD1 + SOURCE_FIELD3
   TARGET_FIELD2 = ,ADD(SOURCE_FIELD2, SOURCE_FIELD4)
}
FROM CDCIN;
In the main SELECT subcommand, check the STATUS field in the source datastore. If the STATUS field is 'AAA' then call PROC MAP_CASE1 otherwise, call PROC MAP_CASE2 as shown below.
SELECT
{
   IF  STATUS = 'AAAA'
   {
       CALLPROC(MAP_CASE1)
   }
   ELSE
   {
       CALLPROC(MAP_CASE2)
   }
FROM CDCIN;