We have many sets of Global changes and some have values that are set incorrectly. For example, the Global Change code of ASTC (Table Creator of an Alias) has a value specified and it should not and we want to identify the Global Change Set Names where this occurs.
The table that stores the Global Change information is the PTMG5_GLOBAL _# table and the column name where the data is stored is the SEGMENT column which is VARCHAR(4028).
If you are simply looking for a value of all spaces in either the FROM or TO value, a LIKE string of 18 spaces surrounded with percent signs (%) can be used. This should be used with NODE_TYPE = 2.
Sample Query:
SELECT *
FROM PTI.PTMG5_GLOBAL_#
WHERE NODE_TYPE = 2
AND SEGMENT LIKE '% %'; (18 spaces between the % signs)
The result from this query would provide a list of Global Change sets with all spaces in either the FROM or TO value.
When looking for Global Change FROM values for a specific ID, the LIKE string can be prefixed with the Global Change ID (i.e. ASTC).
Sample Query:
SELECT *
FROM PTI.PTMG5_GLOBAL_#
WHERE NODE_TYPE = 2
AND SEGMENT LIKE '%ASTC %'; (18 spaces between ASTC and ending % sign)
When looking for Global Change TO values for a specific ID, the LIKE string can be prefixed with the Global Change ID (i.e. ASTC and the TO field can identify the specific value (USER01).
Sample Query:
SELECT *
FROM PTI.PTMG5_GLOBAL_#
WHERE NODE_TYPE = 2
AND SEGMENT LIKE '%ASTC USER01 %';
(18 spaces between ASTC and USER01 and then 18 spaces between USER01 and ending % sign)
The SEGMENT column on the PTMG5_GLOBAL_# table can be broken down as follows:
Count(number of Global Change rules) half-word
The following occurs based on Count:
Global Change ID (i.e., ASTC) CHAR(4)
Value FROM - CHAR(18)
Value TO - CHAR(18)
NOTE: Value FROM or Value TO, if the expression is longer than CHAR(18), the value is in an internal format. This internal format is represented by a hex string starting with x'FFFE'.