if and else condition in tmap expression

One Star

if and else condition in tmap expression

Hi,
I need to use the below if and else condition in tmap expression.

IF ST_ABBR IN (‘CT’,’MA’,’ME’,’NH’,’RI’,’VT’)
   MOVE 'N'           TO SSI-OMB-TYPE (alpha 1 byte)
ELSE
   MOVE 'M'           TO SSI-OMB-TYPE (alpha 1 byte)

I'm using the below condition in tmap and please let me know if anything is wrong
zip_Denorm_unload.ST_ABBR==("CT","MA","ME","NH","RI","VT")?"N":"M"



Thanks,

Re: if and else condition in tmap expression

Hi yugandhar9,
I like to know type of ST_ABBR. Is it string.
If it is string then you can use following expression:
 row1.name.matches("val1 | val2 | val 3") ? "value1" :"value2";
Regards,
Amol  
One Star

Re: if and else condition in tmap expression

Thank you Amol!It worked

Re: if and else condition in tmap expression

Welcome..!!
Nice to see that solution worked for you.
Regards,
Amol.