InfoSphere Optim

 View Only
  • 1.  Using Affinity Provider in LUA

    Posted Thu September 05, 2019 05:08 PM
    Hello,

    I'm trying to use LUA to take a substring of my column value and mask it using the Affinity provider, but I must be missing how to pass the value of the substring to the call.

    Example:
    Source Value = ABCD12345999

    I want to perform a substring function to get the value "12345" from the source value.  I accomplish that by doing:
    myString = string.sub("ABCD12345999", 5, 9)

    Result:
    myString = 12345

    Next:
    How do I construct the Affinity call to use "myString" as the source?

    Thank you,
    Trong

    ------------------------------
    Trong Bo
    Senior Environment Administrator
    HealthNow New York
    ------------------------------

    #InfoSphereOptim
    #Optim


  • 2.  RE: Using Affinity Provider in LUA

    Posted Tue March 31, 2020 04:32 PM
    Hi Trong
    To pick a specific part of string and mask, you no need to write LUA. You can use Affinity as is.

    Try below example : --

    TRANS PRO=aff, algo=fpe, mtd=rep, key="xyzabcxyz", COPY=(1,4), COPY=(5,2), iterations=12, tweaks=no, flddef1=(name="Source field name", dt=varchar)​

    ------------------------------
    Harshavardhan Peddireddy
    ------------------------------