In Datastage C++ varchar is Null, how to handle gracefully?
I am trying to execute the C++ program from the DataStage client. I was getting the following error message.
buildop_200,8: Fatal Error: Null value on the accessor interfacing to field "field1".
Looks like it was receiving the Null values in the coulmn 'field1' from the input file. Even though i am handling the NULL check in my buildop c++ code, it’s still failing when i am running this buildop (C++ code) through the DataStage job.
How to handle NULL values (if column value [c++ varchar/string] is null) gracefully in the Datastage?
This is what I am currently handling in the code….
Could you please help me with this problem? I apprecite your help in this regard.
if (in0.field1 == 0 || in0.field1 == '\0' || in.field1 == ' ') /*** NULL check ****/
if ((in0.field1 == 'N') && (in0.field2.substring(1, 2) == in0.Orig_Code))
// More C++ logic, if statements