IBM Optim

IBM Optim

Enable Data Operations with Optim for AI and Cloud - accelerating innovation, reducing costs, ensuring data sovereignty


#Dataintegration
#Databases
#InfoSphereOptim
#Analyticstools
 View Only
  • 1.  LUA in MF - "FLDDEF Not Found - Error"

    Posted 06/16/20 05:12 AM
    Hello Everyone ,

    Hope you all are safe and sound.

    I'm getting a strange error when trying to use a LUA for masking first and last name in Mainframe. This LUA is already coded and tested successfully in "Optim Distributed/Classic". The error is 

    "Parser Service:
     ODPP Parser:
     IOQDP3060E: The Mandatory Parameter FLDDEF was not found.The Parameter FLDDEF must be specified.Parser Exits.Provide a valid parameter string to restart the process."

    I have provided the field definitions of all the destination and lookup table columns and even tried adding the source table columns as well and this error is something I did not face in Optim Classic/Designer.

    Please provide your expert opinion on this.

    ------------------------------
    - Hari
    ------------------------------

    #InfoSphereOptim
    #Optim


  • 2.  RE: LUA in MF - "FLDDEF Not Found - Error"

    Posted 06/17/20 09:46 AM

    Can you share what the provider string in the call to optim.mask looks like?

    ------------------------------
    Tammy Ziegler
    ------------------------------



  • 3.  RE: LUA in MF - "FLDDEF Not Found - Error"

    Posted 06/17/20 01:42 PM
    Hello Tammy,

    Thanks for your response.

    Here is the hash lookup string used in the optim.mask function

    PRO=HASH_LOOKUP,HASHFLD="SEQ_NUM",SRC="CLNT_LST_NM",DEST="CLNT_LST_NM,CLNT_FST_NM",
    REPLACE="LAST_NAME,FIRST_NAME",lib=DB2ZOS,id="lookname",conn=OPTIMDB,userid=hari,pass=pwd,
    FLDDEF1=(NAME=CLNT_LST_NM,DT=CHAR,LEN=30),
    FLDDEF2=(NAME=CLNT_FST_NM,DT=CHAR,LEN=20),
    FLDDEF3=(NAME=LAST_NAME,DT=CHAR,LEN=60),
    FLDDEF4=(NAME=FIRST_NAME,DT=CHAR,LEN=60)

    ------------------------------
    Hariharan Paramasivam
    ------------------------------



  • 4.  RE: LUA in MF - "FLDDEF Not Found - Error"

    Posted 06/17/20 04:40 PM
    Hi,
    First, have a look at the following document: https://www.ibm.com/support/pages/node/545031

    The important points here are:
    1. There is a 1-1 mapping between the field names in DEST and REPLACE. REPLACE columns do not need FLDEFs.
    2. LUA optimmask() data arguments count must match the number of FLDDEFn (in other words, this is the count of SOURCE and DEST fields, irrespective of whether PRExxx is specified or not). The SOURCE are the values passed in on the optimmask() invocation. DEST are the values returned on the stack as the result. THE FLDDEFs define ONLY these values. So you need a total of 3 FLDDEFs.
    3. Note that your request references 3 values between SRC and DEST. The names you assign to these values are for documentation purposes only and to create the connection between SRC/DEST and the respective FLDDEFs. Optim for z/OS requires that they be UNIQUE. In this scenario we have CLNT_LST_NM which is there twice. This is invalid. You need to provide unique names.

    Try this:

    PRO=HASH_LOOKUP,HASHFLD="SEQ_NUM",SRC="CLNT_LST_NM",DEST="CLNT_LST_NM2,CLNT_FST_NM",
    REPLACE="LAST_NAME,FIRST_NAME",lib=DB2ZOS,id="lookname",conn=OPTIMDB,userid=hari,pass=pwd,
    FLDDEF1=(NAME=CLNT_LST_NM,DT=CHAR,LEN=30),
    FLDDEF2=(NAME=CLNT_LST_NM2,DT=CHAR,LEN=30),
    FLDDEF3=(NAME=CLNT_FST_NM,DT=CHAR,LEN=20)

    Make sure you are using current service level of the code. APARs PH16973(B70) PH21069(B30) delivered the latest set of fixes and enhancements.

    ------------------------------
    Greg Czaja
    Optim for z/OS Dev.
    Unicom
    ------------------------------



  • 5.  RE: LUA in MF - "FLDDEF Not Found - Error"

    Posted 06/19/20 11:27 AM
    Edited by System Admin 01/20/23 04:09 PM
    Thank you for your response and information Greg. I was not well , thats why couldnt respond immediately.

    I went through the link you provided and also the syntax document attached to the link. I made the below modifications based on your suggestions:

    1. Removed the FLDDEF's for columns in the REPLACE Option and retained the FLDDEF's of the SRC and DEST Columns.
    2. Ensured that the LUA optim.mask() data arguments count match the number of FLDDEFs, in this case 2.
    3. Ensured the names assigned are Unique.

     Below is a snap of the Provider string:

     PRO=HASH_LOOKUP,HASHFLD="SEQ_NUM",SRC="CLNT_LST_NM",DEST="CLNT_FRST_NM",REPLACE="FIRST_NAME",id="OPTM.LOOKNAME2",lib=DB2ZOSSQL,conn=OPTMDB01,user=N***,pass=D******,FLDDEF1=(NAME=CLNT_LST_NM,DT=CHAR,LEN=30),FLDDEF2=(NAME=CLNT_FRST_NM,DT=CHAR,LEN=20)

     Even now, I'm ending up with the same error as mentioned below.

     Error :-

     T1.IN_CLNT(CLNT_LST_NM): Column Map Procedure set on column       

    CLNT_LST_NM in destination table T1.IN_CLNT encountered an error at

    line 19 while processing row 1: optimmask:                        

    Parser_Service:                                                    

    ODPP Parser:                                                      

    IOQDP3060E: The mandatory parameter FLDDEF was not found.The parameter FLDDEF must be specified. Parser exits.. Provide a  

    valid parameter string and restart the process.                   


    We are using OPTIM version 11.7.0 (installed on Jan 2020) and Mainframe version is 2.4.
    Out of the two APARS , one has been enabled and the PH21069 will be enabled.
    I'm attaching the LUA as well here for reference. Kindly let me know your thoughts.

    ------------------------------
    Hariharan Paramasivam
    ------------------------------



  • 6.  RE: LUA in MF - "FLDDEF Not Found - Error"

    Posted 06/19/20 12:06 PM
    I see that you have a case opened in SF, why don't we continue there if more help is needed.
    I have taken your chunk and adopted it slightly to my lookup table and ran it.

    tparm:PRO=HASH_LOOKUP,HASHFLD="OPTIM_SEQ_NBR",SRC="CLNT_LST_NM",DEST="CLNT_FRST_NM",REPLACE="FST_NM",id="DBTTDT0.
    OPTIM_LKUP_NME",lib=DB2ZOSSQL,conn=OPTMDB01,user=N***,pass=D*******,FLDDEF1=(NAME=CLNT_LST_NM,DT=CHAR,LEN=30),
    FLDDEF2=(NAME=CLNT_FRST_NM,DT=CHAR,LEN=20)

    The first time through I an error of:
    CM PROCEDURE aborted with the following error:
    DBTDAPOD.INDIV_PRTYF(FST_NM): Column Map Procedure set on column
    FST_NM in destination table DBTDAPOD.INDIV_PRTYF encountered an error
    at line 19 while processing row 1: optimmask:
    Parser_Service:
    ODPP Parser:
    IOQDP3055E: The separator is invalid The key-value pairs in the parameter string must be separated by a comma Parser exits. Provide a valid parameter string and restart the process.

    This because of user=N***,pass=D*******, which contain invalid characters of '*' and are not needed to z/OS.
    I changed these to user=N,pass=D,  and the chunk executes without errors and replaces the source value as it should be. Here is the final revision:

    1 --Lua
    2 function cm_transform()
    3 COL_NM = ' '
    4 FST_NM = ' '
    5 COL_NM = optim.source.getcolumnname()
    6 FST_NM = "CLNT_FRST_NM"
    7 L_NAME = ' '
    8 L_NAME = optim.source.getcolumnvalue(COL_NM)
    9 t1 = 'PRO=HASH_LOOKUP,HASHFLD="OPTIM_SEQ_NBR",'
    10 t1 = t1 .. 'SRC="CLNT_LST_NM",'
    11 t1 = t1 .. 'DEST="CLNT_FRST_NM",'
    12 t1 = t1 .. 'REPLACE="FST_NM",'
    13 t1 = t1 .. 'id="DBTTDT0.OPTIM_LKUP_NME",lib=DB2ZOSSQL,conn=OPTMDB01,'
    14 t1 = t1 .. 'user=N,pass=D,'
    15 t1 = t1 .. 'FLDDEF1=(NAME=CLNT_LST_NM,DT=CHAR,LEN=30),'
    16 t1 = t1 .. 'FLDDEF2=(NAME=CLNT_FRST_NM,DT=CHAR,LEN=20)'
    17 fname = ' '
    18 optim.print("tparm:" .. t1)
    19 fname=optim.mask(L_NAME,t1)
    20 optim.target.setcolumnvalue(fname)
    21 end

    Since you received a different error I am wondering if you are using the current level of the ODPP libraries. I am providing instructions for running with TRACE in SF so we can check on that.
    A few additional comments:
    1. optim.source.getcolumnvalue() does not need a column name when executed on the current column. Saves on cycles.
    2.The creation of the request string should be removed from cm_transform and placed in cm_load. The way it is being done now (on every row processed) is very expensive and drains memory and CPU. with cm_load use it will be executed once.


    ------------------------------
    Greg Czaja
    Optim for z/OS Development
    Unicom Systems Inc.
    ------------------------------