Null record drop warinig

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
samsuf2002
Premium Member
Premium Member
Posts: 397
Joined: Wed Apr 12, 2006 2:28 pm
Location: Tennesse

Null record drop warinig

Post by samsuf2002 »

Hi All, I am running a parallel job which loads the data from 2 sequential file and load in SQL server using ODBC stage . I am using CDC , look up, sort , join stages in this job . I have a field Address2 (varchar 30 , nullable) which contain addresses and email addresses so i need map this field to EMAIL_ADDR field in my target table there fore i am using this logic--

IF count (DSLink231.Address2 ,'@') =1 THEN DSLink231.Address2 ELSE SetNull()

i am getting this warning and it is rejecting around 5 million recs out of 28 million.

APT_CombinedOperatorController(2),1: Field 'Address2' from input dataset '0' is NULL. Record dropped.

I have this field Nullable every where in my job

Any help will be appreciated

Thanks
hi sam here
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Can you double check at the database level, wheather this field really is nullable or not.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
samsuf2002
Premium Member
Premium Member
Posts: 397
Joined: Wed Apr 12, 2006 2:28 pm
Location: Tennesse

Post by samsuf2002 »

It is Nullable in Database
hi sam here
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

Try something like this:

Code: Select all

If (IsNull(DSLink231.Address2) or count(DSLink231.Address2 ,'@')<>1) then SetNull() Else DSLink231.Address2
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

You can also try this.

Code: Select all

IF count (NullToEmpty(DSLink231.Address2) ,'@') =1 THEN DSLink231.Address2 ELSE SetNull() 
samsuf2002
Premium Member
Premium Member
Posts: 397
Joined: Wed Apr 12, 2006 2:28 pm
Location: Tennesse

Post by samsuf2002 »

I used

if isnotnull(DSLink332.Address2) = 1 then ( IF Count(DSLink332.Address2, '@') = 1THEN DSLink332.Address2 ELSE SetNull()) else SetNull()

it worked fine.

Thanks to All
hi sam here
us1aslam1us
Charter Member
Charter Member
Posts: 822
Joined: Sat Sep 17, 2005 5:25 pm
Location: USA

Post by us1aslam1us »

Balaji's logic seems to be much simpler and efficient.
I haven't failed, I've found 10,000 ways that don't work.
Thomas Alva Edison(1847-1931)
DS_MJ
Participant
Posts: 157
Joined: Wed Feb 02, 2005 10:00 am

Post by DS_MJ »

I am geeting the same error but for a timestamp field.
APT_CombinedOperatorController,1: Field 'UP_FOR_RENL_DT' from input dataset '0' is NULL. Record dropped.
COL_DATE is set to Nullable
COL_DATE is a Timestamp field.

This col on source side is a date col and on the target its a Timestamp col.

I convert the date col to timestamp col using the following:

Code: Select all

DateToString(Appointment_Data_lnk.ORIG_ISSUE_DT,"%yyyy-%mm-%dd"):' 00:00:00.000'
However, I get the above error. How do I do a check for nullable..?
What is wrong with this ?

Code: Select all

[quote]If IsNULL(DateToString(Appointment_Data_lnk.ORIG_ISSUE_DT,"%yyyy-%mm-%dd"):' 00:00:00.000') then SetNull() Else (DateToString(Appointment_Data_lnk.ORIG_ISSUE_DT,"%yyyy-%mm-%dd"):' 00:00:00.000')[/quote]
Thanks.
Thanks in advance,
DS_MJ
Participant
Posts: 157
Joined: Wed Feb 02, 2005 10:00 am

Post by DS_MJ »

Hello Problem resolved:

Code: Select all

If IsNULL(Appointment_Data_lnk.ORIG_ISSUE_DT then SetNull() Else DateToString(Appointment_Data_lnk.ORIG_ISSUE_DT,"%yyyy-%mm-%dd"):' 00:00:00.000'
Thanks in advance,
Post Reply