InfoSphere Optim

 View Only
  • 1.  Lua script issue with has lookup, unsupported flddef data type

    Posted Tue March 21, 2023 09:23 AM

    Hello all,

    I'm trying to create a hash lookup using Lua, this is my code:

    function cm_transform()
        lastName= optim.source.getcolumnvalue()
        print(lastName)
        if lastName ~= nil then
            params='PRO=HASH_LOOKUP,HASHFLD="SEQ",SRC="LASTNAME", REP="LASTNAME",id=OPTIM_USER.OPTIM_ES_LASTNAME, lib=DB2LUW, conn=PRUEBA, user=user, pass="pass",FLDDEF1=(NAME="LASTNAME",DATATYPE=VARCHAR)'
            print(params)
            newvalue = optimmask(lastName, params)
            optim.target.setcolumnvalue(newvalue)
        else
            optim.target.setcolumnvalue(lastName)
        end    
    end
    The problem is that it's giving me the next error:
    User DLL or Proc requested termination while processing SAMPLE.CDAPRT.AD_USER Column Map Procedure set on column LASTNAME encountered an error at line 8 while processing row 2: attempted an optim.mask request with unsupported flddef data type specified.

    Due to the lack of documentation and my short knowledge about it, I don't know what it is wrong with that. You can provide me with any additional corrections or ideas in order for me to fix this, I would greatly appreciate it.



    ------------------------------
    Anthony García
    ------------------------------


  • 2.  RE: Lua script issue with has lookup, unsupported flddef data type

    IBM Champion
    Posted Tue March 21, 2023 07:43 PM
    Hi,

    For that table, I usually use either WVARCHAR or WVARCHAR_SZ.

    Give that a try.

    --

    Jimmy Wilson


    1999 S. Bascom Ste 700

    Campbell, CA 95008

    Phone +1(972) 567-5558

    jwilson@abmartin.com

     

    Unstructured Data Masking

    Data Privacy/Test data Management - fabrication, optimization, obfuscation






  • 3.  RE: Lua script issue with has lookup, unsupported flddef data type

    Posted Tue March 21, 2023 08:24 PM

    Thanks Jimmy,

    I tried changing the value to WVARCHAR_SZ and the error changed to: 

    User DLL or Proc requested termination while processing SAMPLE.CDAPRT.AD_USER Row: 2: Column: LASTNAME: Error in Column Map Procedure or expression: while executing cm_transform(): 22: Unexpected internal error. Check trace file for cause.

    Does anyone know what file it refers to?



    ------------------------------
    Anthony García
    ------------------------------



  • 4.  RE: Lua script issue with has lookup, unsupported flddef data type

    Posted Tue March 21, 2023 11:47 PM

    Hi,

    It is not related to any file, LUA raises this kind of generic error if something is not correct in the script. You may have to try with simple lines and do incremental changes if there is no error in the previous change.



    ------------------------------
    Tulasi Das Uppu
    ------------------------------



  • 5.  RE: Lua script issue with has lookup, unsupported flddef data type

    Posted Mon March 27, 2023 02:23 PM

    Hi,

    I solved the issue, the function needed the DEST parameter but it is not specified in the documentation.

    Now i have a diferent issue, I'm trying to use a table with Spanish last names that have accent marks as the lookup table.

    If the new data value is "Meléndez"

    Optimmask only use the characters before the accent mark.

    In the trace file i have this error

    COLCLUA          l_OnOdppProviderServiceError    (7241) EXCP 03/27/2023 10:26:18 000059 00001038 00003190
                                     Row 10: Error code: 5926: ODPP Lookup Service Provider.
     COLCLUA          l_OnOdppProviderServiceError    (7242) EXCP 03/27/2023 10:26:18 000060 00001038 00003190
                                     IOQDP0335E: Failed to convert replacement field LASTNAME LDS value.
     COLCLUA          l_OnOdppProviderServiceError    (7243) EXCP 03/27/2023 10:26:18 000061 00001038 00003190
                                     There was a error converting the replacement data value to Lookup temporary format Provider skips th
                                     e row and continues processing the next row. Please check the data value in replacement field for an
                                     y unreadable or special characters outside the range of code page and encoding used..

    How can i change the "lookup temporary format"?



    ------------------------------
    Anthony García
    ------------------------------



  • 6.  RE: Lua script issue with has lookup, unsupported flddef data type

    Posted Mon March 27, 2023 05:18 PM

    Hi all, 

    I solve all issues, 

    I compare how I solved it in case someone has this error

    The function needs the workstation code page, in my case is 1252

    The workstation code page is in trace file

    here are my params

    params = 'PRO=hash_lookup,HASHFLD="SEQ",SOURCE="LASTNAME", DEST="LASTNAME", REP="LASTNAME",'
            params = params..'id=OPTIM_USER.OPTIM_ES_LASTNAME,lib=DB2LUW,conn=PRUEBA,user=user, pass="pass",'
            params = params..'FLDDEF1=(NAME="LASTNAME",DATATYPE=WVARCHAR_SZ, LEN=60, CP=1252, CPTYPE=DB2)'



    ------------------------------
    Anthony García
    ------------------------------