Topic
  • 4 replies
  • Latest Post - ‏2012-06-07T13:48:50Z by SystemAdmin
SystemAdmin
SystemAdmin
301 Posts

Pinned topic What is the simplest way to mask with string litteral if source is not null

‏2012-03-10T17:10:49Z |
Hello
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?
Thanks!
Updated on 2012-06-07T13:48:50Z at 2012-06-07T13:48:50Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    301 Posts

    Re: What is the simplest way to mask with string litteral if source is not null

    ‏2012-04-24T03:10:16Z  
    Hi - 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.
  • SystemAdmin
    SystemAdmin
    301 Posts

    Re: What is the simplest way to mask with string litteral if source is not null

    ‏2012-05-09T13:12:12Z  
    Hi - 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.
    Thanks 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
    Ducatiman
    58 Posts

    Re: What is the simplest way to mask with string litteral if source is not null

    ‏2012-06-06T22:59:57Z  
    unfortunately I create lookup table with one line. then do the ignore null spaces zero length...
  • SystemAdmin
    SystemAdmin
    301 Posts

    Re: What is the simplest way to mask with string litteral if source is not null

    ‏2012-06-07T13:48:50Z  
    • Ducatiman
    • ‏2012-06-06T22:59:57Z
    unfortunately I create lookup table with one line. then do the ignore null spaces zero length...
    if 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.