Sequential file

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

Post Reply
sheema
Premium Member
Premium Member
Posts: 204
Joined: Sat Jul 22, 2006 10:20 am

Sequential file

Post by sheema »

I am slowly trying to transition from server to parallel,so please bear with me.
I have a sequential file as a source which has a varchar column Col1(nullable set to yes).
So for that particular column i have set the Null field value to ' '.
So this means that if file encouters null value for the column col1 it will replace it with
a ' '.
After the sequential file i have transformer and then my target is also Sequential file.
Now my question is do i have to check for ISNull(Col1) in transformer as my Target sequential file
has nullable for that column set to No.



Thanks
DSDexter
Participant
Posts: 94
Joined: Wed Jul 11, 2007 9:36 pm
Location: Pune,India

Post by DSDexter »

Welcome aboard . There is a difference in ' ' and NULL. So in transformer you need to check for ' ' and not NULL. Also If your target is Nullable No then do you need to retain those records or reject them? Please give some sample records,With the metadata definations.
Thanks
DSDexter
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

Your business rule should state the course of action you need to take when you encounter null. Follow it.

Yes, you need to check for IsNull()
DSDexter
Participant
Posts: 94
Joined: Wed Jul 11, 2007 9:36 pm
Location: Pune,India

Post by DSDexter »

Ascii Value of NULL is 000

Ascii Value of Space is 032. If you are replacing the Nulls by ' ', Then IsNull() function will always be false I guess. 8)
Thanks
DSDexter
sheema
Premium Member
Premium Member
Posts: 204
Joined: Sat Jul 22, 2006 10:20 am

Post by sheema »

Ok,I should handle the nulls as i have set the Nullable column in Target sequential file to No.
If they want me to populate the Null values too,should i set to Nullable column to Yes and probably not check for IsNull() in the transformer.
Am i right.

Thanks
DSDexter
Participant
Posts: 94
Joined: Wed Jul 11, 2007 9:36 pm
Location: Pune,India

Post by DSDexter »

Sheema,

Since you are replacing NULL with a ' ' @source. In Transformer you need to check for ' ' and apply the bussiness logic. If you want to populates nulls in the target stage, Then in transformer you can write this derivation,

If
lnk.inputcolumn = ' '
Then
SetNull()
Else
lnk.inputcolumn.

Now map the column to the output column with output as nullable yes. Make sure you have done Null handling at target side Sequential stage also.

Cheers
Thanks
DSDexter
sheema
Premium Member
Premium Member
Posts: 204
Joined: Sat Jul 22, 2006 10:20 am

Post by sheema »

If they want me to replace a Null for Col1 in source with ' ' than i should'nt be handling anything in the transformer right.I just have to set the Null Handle Value for that column to ' '.
Am i right.

Thanks
DSDexter
Participant
Posts: 94
Joined: Wed Jul 11, 2007 9:36 pm
Location: Pune,India

Post by DSDexter »

sheema wrote:If they want me to replace a Null for Col1 in source with ' ' than i should'nt be handling anything in the transformer right.
Yes thats right, :D But I think you should check with the business requirement 8)
Thanks
DSDexter
Post Reply