Purpose of setting Nullable property as 'No'??

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

joesat
Participant
Posts: 93
Joined: Wed Jun 20, 2007 2:12 am

Post by joesat »

Ok, my favourite editor is Edit Plus :-)
The sample record I am giving is

12345||||ABCDE

The three fields in the middle have no values... how do I check what kind of null is used there?

Thanks.
Joel Satire
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Ok, you now have the 3rd option - neither NULL nor SQL.NULL but just an empty field. This will come into a VarChar field as '', or an empty string {which is very different from null!}. What Minhajuddin wrote now applies, but only sort-of. Basically, unless you are loading to a VarChar2 Oracle these values will not be null so the nullability attributes on the columns really don't apply.

In the case of data types that do not allow '' as a value - i.e. date, time, timestamp, and any numeric type you would use the default value attribute to change this value to a legal value or you could make the column nullable and use the attributes to set a null value.

In the case of strings you could use what Minhajuddin suggested to do the same.

So your columns would come out of the sequential file stage as nullable and any illegal values in the file would be converted to nulls. Then you can use whatever method you like to handle those nulls in the subsequent stages.
joesat
Participant
Posts: 93
Joined: Wed Jun 20, 2007 2:12 am

Post by joesat »

Thanks for the explanation, ArndW

But if I were to use Minhajuddin's suggestions, then I will have to set the Nullable property to 'Yes', right? This again is not my requirement (sorry!)
I want records having null values to be REJECTED by Datastage... these records should NOT come into the main process at all, it should be rejected while the input is read in the first place... but this doesn't seem to be happening...
Joel Satire
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Do you have a reject link on your Sequential File stage - the one that reads the file?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply