Connect CDC (SQData) supports two types of substitution parameters, Named and Positional, which define variables to be used within an Apply Engine script. The Named parameter takes the form %(<parm_name>) and is explicitly assigned its value in a parameter list passed to the Parser. The Named parameter is not constrained by the length of the parameter string which is particularly important on the z/OS platform where the string is limited to less than 80 characters. The Positional parameter, which is being deprecated, takes the form %nn and is assigned based on its position in a parameter list passed to the Parser.
Substitution variables enable you to dynamically change the meaning/value of certain fields within an Apply Engine script during the Parse process. For example, you may have a test and production target datastore with the same name, which are differentiated by a high level qualifier (TEST and PROD). In this case, you can use a substitution variable to point to either the test or production target datastore. The examples below detail how this can be accomplished using both types of parameters.
Connect CDC (SQData) allows up to 100 substitution variables to be passed to the Apply Engine script through the parser.
Syntax
%(<parm_name>) | %<nn>
Parameter Description
(<parm_name>)
A string enclosed in parenthesis follows the % character.
<nn>
A two-digit number starting from 00 to 99 follows the % character. The first substitution variable is always 00, the second substitution variable is 01, etc. This corresponds to the position of the substitution parameter passed to the Parser when it is invoked.
Please refer to section Parse a Script for more information about invoking the Parser.
Example 1
PROCESS INTO %(ENV2).TARGET
SELECT*
FROM %(ENV1).INPUT;
The Parser is invoked using TEST and PROD in the parameter list as follows:
SQDPARSE script_in.sqd script_out.prc ENV1=PROD ENV2=TEST
PROCESS INTO TEST.TARGET
SELECT*
FROM PROD.INPUT;
Example 2
PROCESS INTO%00.TARGET
SELECT*
FROM%01.INPUT;
The Parser is invoked using TEST and PROD in the parameter string as follows:
SQDPARSE script_in.sqd script_out.prc TEST PROD
PROCESS INTO TEST.TARGET
SELECT*
FROM PROD.INPUT;