Optim - Test Data Management and Archiving

Expand all | Collapse all

Using Affinity Provider in LUA

  • 1.  Using Affinity Provider in LUA

    Posted Thu September 05, 2019 05:08 PM

    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.

    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)

    myString = 12345

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

    Thank you,

    Trong Bo
    Senior Environment Administrator
    HealthNow New York

  • 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