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.
------------------------------
Original Message:
Sent: Fri June 19, 2020 11:26 AM
From: Hariharan Paramasivam
Subject: LUA in MF - "FLDDEF Not Found - Error"
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:
- Removed the FLDDEF's for columns in the REPLACE Option and retained the FLDDEF's of the SRC and DEST Columns.
- Ensured that the LUA optim.mask() data arguments count match the number of FLDDEFs, in this case 2.
- 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
------------------------------
Original Message:
Sent: Wed June 17, 2020 04:39 PM
From: Gregory Czaja
Subject: LUA in MF - "FLDDEF Not Found - Error"
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
Original Message:
Sent: Wed June 17, 2020 01:41 PM
From: Hariharan Paramasivam
Subject: LUA in MF - "FLDDEF Not Found - Error"
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
Original Message:
Sent: Wed June 17, 2020 09:46 AM
From: Tammy Ziegler
Subject: LUA in MF - "FLDDEF Not Found - Error"
Can you share what the provider string in the call to optim.mask looks like?
------------------------------
Tammy Ziegler