NULLS

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
kab123
Participant
Posts: 92
Joined: Tue May 18, 2004 4:05 pm

NULLS

Post by kab123 »

Hi,

In my source csv file, I am getting some nulls without quotes ...DataStage is writing it to a seq file as a "?" instead nulls..Why is this happening..? I am using a after-job subroutine shell script to scrub "?' to NULLS..but I would like to know the reason and try to resolve it in the beginning...
any clues..?

Thanks
kab123
Participant
Posts: 92
Joined: Tue May 18, 2004 4:05 pm

Post by kab123 »

I dont see any warnings or errors in my log too...
I dont even realize what kind of problems it may lead like lookup failures etc...any ideas, Pls let me know...
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Do you have any NULL pad char?
kab123
Participant
Posts: 92
Joined: Tue May 18, 2004 4:05 pm

Post by kab123 »

Do you mean Default NULL padding...I leave it blank...
Here is how it is happening...
File1 is read and written to File2 -- File 1 has some nulls..written as nulls in File2.. so far fine
Again, in next job, File 2 is read and written to File 3--- here the Nulls in File 2 are wriiten as "?" in File 3...
in the same way, in some other scenarios:
nulls without quotes in csv files are read as nulls but written as "?" in o/p files..looks weired..
any idea from this...pls?
kab123
Participant
Posts: 92
Joined: Tue May 18, 2004 4:05 pm

Post by kab123 »

Sai,

And to my surprise...not all nulls in all fields do this...only few fields..
Do I need to configure NLS or something....?

Thankx
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Have you given the quotes char? It may mis-interpret it to into '?'
MaheshKumar Sugunaraj
Participant
Posts: 84
Joined: Thu Dec 04, 2003 9:55 pm

Post by MaheshKumar Sugunaraj »

Could you please check by passing srNVL(columnname,"") in which ever column you have Null values.

Hope this helps.

Thanks & Regards
Mahesh
kab123
Participant
Posts: 92
Joined: Tue May 18, 2004 4:05 pm

Post by kab123 »

Mahesh,

What does this function do..?
Does this enclose the column in quotes ?...
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

I think it is to replace NULL with quotes.

In short, something like
NULL_To_Default(YourField, Default_For_NULL)

and code being

If IsNULL(YourField) Then Default_For_NULL Else YourField

Thus the value "" will be substituted for Default_For_NULL
MaheshKumar Sugunaraj
Participant
Posts: 84
Joined: Thu Dec 04, 2003 9:55 pm

Post by MaheshKumar Sugunaraj »

As you problem is that there a some Null values which come out as ? , in order to avoid this you could also use a srNVL(COLUMN_NAME," ") which actually puts in an empty value.

Hope this helps.

As Sainath pointed out this will put in a Empty Value.

Regards
Mahesh
Post Reply