MACRO Connection Manager configuration parameter
The MACRO parameter specifies the name of a macro and a value that can be reused in the Connection Manager configuration file.
Usage
The MACRO parameter is optional, and applies to the Connection Manager configuration file.
A macro can contain spaces, but not line breaks.
The MACRO parameter can be set multiple times to create multiple macros.
After a
macro is defined, it can be used in other macros. For example:
MACRO WA=wa_server_1,wa_server_2,wa_server_3,wa_server_4
MACRO OR=or_server_1,or_server_2,or_server_3,or_server_4
MACRO ID=id_server_1,id_server_2,id_server_3,id_server_4
MACRO PNW=${WA),${OR),${ID)
Example 1: Using a macro in a service-level agreement
In the following example, the macro CA contains the names of eight servers.
NAME my_connection_manager_1
MACRO CA=ca_server_1,ca_server_2,ca_server_3,ca_server_4, \
ca_server_5,ca_server_6,ca_server_7,ca_server_8
CLUSTER my_cluster_1
{
INFORMIXSERVER group_name_1
SLA sla_1 DBSERVERS=${CA}
FOC ORDER=ENABLED PRIORITY=1
}
The macro expands in the following way:{
INFORMIXSERVER group_name_1
SLA sla_1 DBSERVERS=ca_server_1,ca_server_2,ca_server_3,ca_server_4, \
ca_server_5,ca_server_6,ca_server_7,ca_server_8
FOC ORDER=ENABLED PRIORITY=1
}
Example 2: Using multiple macros in service-level agreements
In the following example, the macros WA, OR, and ID each contain the names of servers. Macro ID also contains parentheses to create a redirection-policy group.
NAME my_connection_manager_2
MACRO WA=wa_server_1,wa_server_2,wa_server_3
MACRO OR=or_server_1,or_server_2,or_server_3
MACRO ID=(id_server_1,id_server_2,id_server_3)
CLUSTER my_cluster_2
{
INFORMIXSERVER group_name_2
SLA sla_1 DBSERVERS=PRI
SLA sla_2 DBSERVERS=${WA},${OR}
SLA sla_3 DBSERVERS=${ID} POLICY=ROUNDROBIN
FOC ORDER=ENABLED PRIORITY=1
}
The macros expand in the following ways:{
INFORMIXSERVER group_name_2
SLA sla_1 DBSERVERS=PRI
SLA sla_2 DBSERVERS=wa_server_1,wa_server_2,wa_server_3,or_server_1,or_server_2,or_server_3
SLA sla_3 DBSERVERS=(id_server_1,id_server_2,id_server_3) POLICY=ROUNDROBIN
FOC ORDER=ENABLED PRIORITY=1
}