How are empty fields better handled
Posted: Wed Oct 26, 2011 1:55 pm
Hi all,
While formating fields for my target seqencial file, I came up with multiple ways of handling fields that are empty and passing default values for those fields.
Following are the ways I thought of, but am not sure if DataStage interprets them the same way and if all ways are equally effecient (or otherwise)
1) Extract those fields as Character and non nullable and thus it passes 'spaces' for fields that are empty and then in transformer do and "If ' ' Then '9999' Else <Field_Value>"
2) Extract all fields as Varchar and nullable and then using NullToValue(<Field_Value>, '9999') in transformer.
Please let me know if any one of this is a preffered method over other?
Thanks,
nsg
While formating fields for my target seqencial file, I came up with multiple ways of handling fields that are empty and passing default values for those fields.
Following are the ways I thought of, but am not sure if DataStage interprets them the same way and if all ways are equally effecient (or otherwise)
1) Extract those fields as Character and non nullable and thus it passes 'spaces' for fields that are empty and then in transformer do and "If ' ' Then '9999' Else <Field_Value>"
2) Extract all fields as Varchar and nullable and then using NullToValue(<Field_Value>, '9999') in transformer.
Please let me know if any one of this is a preffered method over other?
Thanks,
nsg