We are getting errors while executing DB2 masking job using a continuous WHERE statement in the CSV/Transformation map.
Mentioned below is the issue description:
We have a query with a WHERE clause (based on selection criterion) which is available in the CSV Map, but while running the masking job in DB2 it is not able to identify the next line of the continuous WHERE statement in the CSV map.
We have tried creating the file with the below-mentioned attributes but still, the masking job is getting abended.
File Type: VB
Different lengths we have tried for transformation map
LRECL we tried :255,8000,7890
We have shared the screenshot of the error and the transformation map for your reference.
TDM Mainframe 4.9.x 4.10.x
Masking
the maximum length of the MAPCSV in the Mainframe has a LRECL of 1000 bytes.
the maximum length of the MAPCSV in the Mainframe has a LRECL of 1000 bytes.
Just the WHERE clause, in this case, has more than 7000 bytes in it.
If the user takes a look at it, it will be probably truncated, which makes sense to have triggered the error message sent to us.
In this example, we have 7857 bytes in the WHERE clause, which is too big to be parsed properly
Below is the suggested workaround:
Instead of all information on one line break the where clause into multiple lines
AVTALE_CATDM,,WHERE,"UPPER(disponent_navn) not like 'AS %' AND UPPER(disponent_navn) not like '% AS %' AND UPPER(disponent_navn) not like 'ASA %' AND UPPER(disponent_navn) not like '% ASA %' AND.......and upper(disponent_navn) not like '%ENTRE%'",,,,,,,,,,,,,
Try to build the MAPCSV like this:
AVTALE_CATDM,,WHERE,"UPPER(disponent_navn) not like 'AS %'",,,,,,,,,,,,,
AVTALE_CATDM,,AND,"UPPER(disponent_navn) not like '% AS %'",,,,,,,,,,,,,
AVTALE_CATDM,,AND,"UPPER(disponent_navn) not like 'ASA %'",,,,,,,,,,,,,
AVTALE_CATDM,,AND,"UPPER(disponent_navn) not like '% ASA %'",,,,,,,,,,,,,
AVTALE_CATDM,,AND,"UPPER(disponent_navn) NOT LIKE '%BANK%'",,,,,,,,,,,,,
AVTALE_CATDM,,AND,"UPPER(disponent_navn) NOT LIKE '%UNION%'",,,,,,,,,,,,,
AVTALE_CATDM,,AND,"UPPER(disponent_navn) NOT LIKE '%SECUR%'",,,,,,,,,,,,,
AVTALE_CATDM,,AND,"UPPER(disponent_navn) not like '%A/S'",,,,,,,,,,,,,
AVTALE_CATDM,,AND,"UPPER(disponent_navn) not like '%SOCIET%'",,,,,,,,,,,,,
AVTALE_CATDM,,AND,"UPPER(disponent_navn) not like 'SA %'",,,,,,,,,,,,,
AVTALE_CATDM,,AND,"UPPER(disponent_navn) not like '% SA %'",,,,,,,,,,,,,
.... (repeat for each AND in the clause)
AVTALE_CATDM,,AND,"upper(disponent_navn) not like '%ENTRE%'",,,,,,,,,,,,,
AVTALE_CATDM,DISPONENT_NAVN,HASHLOV,FULLNAME,,,,Y,,,,,,,,,
(finalize the clause with the function name etc)
SQLCODE = -010, error: the string constant beginning with "UPPER(dis IS NOT Terminated
SQLSTATE = 42603
this error has the following definition:
Tips N Tricks for Software Developing : DB2 Error codes (lasanthals.blogspot.com)
DB2 SQL-Error: -010 SQLState: 42603
Short Description: THE STRING CONSTANT BEGINNING IS NOT TERMINATED
The statement contains a string constant, beginning with 'string', that is not terminated properly. System action: The statement cannot be executed. Programmer response: Examine the statement for missing quotation marks or apostrophes in the indicated string constant.