I want to replace values in a column by a string litteral (ex:'comments') but only if there is a value in the column, meaning don't put anything if it is null, spaces or empty.
I know I can use a lookup table with the preserve operand or a maybe a column map proc to do this but to me it appears to be some kind of a overhead for simple task.
Are the any direct ways to do this in a column map?
This topic has been locked.
4 replies Latest Post - 2012-06-07T13:48:50Z by SystemAdmin
Pinned topic What is the simplest way to mask with string litteral if source is not null
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Updated on 2012-06-07T13:48:50Z at 2012-06-07T13:48:50Z by SystemAdmin
Re: What is the simplest way to mask with string litteral if source is not null2012-04-24T03:10:16Z in response to SystemAdminHi - Try using a column map procedure. There are examples in the RT\SAMPLES\CMProc folder. You can read about them in the information center at Link: http://publib.boulder.ibm.com/infocenter/idm/v2r2/index.jsp?topic=%2Fcom.ibm.optimd.install.doc%2FapxH_Samples%2Fopinstall-t-sample_column_map_procedures.html
Hope this does the trick for you.
Re: What is the simplest way to mask with string litteral if source is not null2012-05-09T13:12:12Z in response to SystemAdminThanks for the suggestion. I new that was an option but that would work only if your server is on a windows platform. Usually what I do is simply make a lookup and ignore nulls but I found these things to be an overhead for a simple thing to do. That would be a fairly simple enhancement that could be done.
Ducatiman 27000213JK57 Posts
Re: What is the simplest way to mask with string litteral if source is not null2012-06-07T13:48:50Z in response to Ducatimanif you are comfortable with writing 'C' code then you can also write a custom column map exit. It will give you fast execution, better control on data validation and masking i.e. to say you can do much more complex scenarios then just checking for NULL and using string literals.