jzhardy
Active User
Joined: 31 Oct 2006 Posts: 137 Location: brisbane
|
|
|
|
Suppose I have a Table Map XXX.TBLMAP defined for Table1, Table2 ... TableN.
I have defined a column map procedure called XXX.MASK() that performs a set of column level transformations.
On my Table Map XXX.TBLMAP I reference the column map procedure XXX.YYY() against the first column of each table.
eg : my Table Map might show :
Code: |
Extract Tables Destination Table Name Type Column Map
--------------------- ------------------------->> ------- ----------
************************************* TOP **************************
TABLE1 TABLE1 TABLE LOCAL
TABLE2 TABLE2 TABLE LOCAL |
and at the LOCAL column map level I might have ...
Code: |
---TABLE1 ---- -------- ---TABLE1 ---- --------
Cmd Source Column Data Type Num Destination Column Data Type Status
--- ------------------->> ---------- --- ------------------ ---------- ------
*** *********************************** TOP **********************************
___ PROC XXX.YYY() 1 ID DEC(15,0) Lua
abcde CH(4) 2 abcde CH(4) EQUAL
etc
---TABLE2 ---- -------- ---TABLE2 ---- --------
Cmd Source Column Data Type Num Destination Column Data Type Status
--- ------------------->> ---------- --- ------------------ ---------- ------
*** *********************************** TOP **********************************
___ PROC XXX.YYY() 1 ID DEC(15,0) Lua
qwert CH(8) 2 qwert CH(8) EQUAL
etc |
the problem I have with this is :
1\ PROC XXX.YYY() needs to be attached (as above) to every table in my table map XXX.TBLMAP. I really want
it to be tied to Table Map XXX.TBLMAP, not to tables within XXX.TBLMAP. Can this be done ?
2\ contrary to what I would expect - but probably because of 1\ - user exit cm_load() gets called once for every table processed. I use
cm_load() to read from an input file to establish the transformation (masking) rules. I only want to do this once, and also use this User Exit
as a place to set all my global session variables.
Based on IBM's own documentation, function cm_load() should get called once only before any tables are processed. This is the behaviour
that I want, but each reference to XXX.YYY() seems to force a new invocation of cm_load() and hence a new global variable stack.
any help appreciated ! |
|