Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
4 replies Latest Post - ‏2012-06-07T13:48:50Z by SystemAdmin
SystemAdmin
SystemAdmin
304 Posts
ACCEPTED ANSWER

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
    304 Posts
    ACCEPTED ANSWER

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

    ‏2012-04-24T03:10:16Z  in response to SystemAdmin
    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
      304 Posts
      ACCEPTED ANSWER

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

      ‏2012-05-09T13:12:12Z  in response to SystemAdmin
      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
    ACCEPTED ANSWER

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

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

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

      ‏2012-06-07T13:48:50Z  in response to Ducatiman
      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.