Problem in TrimLeadingTrailing

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
kondeti
Premium Member
Premium Member
Posts: 67
Joined: Sat Mar 04, 2006 11:38 am

Problem in TrimLeadingTrailing

Post by kondeti »

Dear All

I am reading a file from Unix through Sequential file Stage it contian 82 columns all columns I am reading as NVarchar and Null is Yes. After that in transformer I am upplying TrimLeadingTrailing function for all the 82 columns and sending into the Target Database SQLServer 2005.

This job unable to populate the data into the Database. Sequential file stage is reading the data but transformer satage is not allowing to populate in to the target. If i remove TrimLeadingTrailing function from all the columns then it populating data in to the Target but as per the client requirement I need to implement TrimLeadingTrailing function for all the columns. please help me on this
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

Can you post any errors or warnings reported.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Etiquette Note
When a problem is resolved, we post some information as to HOW it was resolved, the better to assist future searchers.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kondeti
Premium Member
Premium Member
Posts: 67
Joined: Sat Mar 04, 2006 11:38 am

Post by kondeti »

This is the warning I am getting

APT_CombinedOperatorController,0: Field 'Field002' from input dataset '0' is NULL. Record dropped.
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

kondeti wrote:This is the warning I am getting

APT_CombinedOperatorController,0: Field 'Field002' from input dataset '0' is NULL. Record dropped.
Handle Null while trimming.
kondeti
Premium Member
Premium Member
Posts: 67
Joined: Sat Mar 04, 2006 11:38 am

Post by kondeti »

As per the client requirement I can't handle any null values and I can't eleminate TrimLeadingandTrailing function. The same thing I Implemented in couple of jobs I didn't get this problem. Please provide your inputs.
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

If the incoming value is not null then trim the value else do not trim it.
Using TrimLeadingTrailing function on a null value will cause record to be dropped. Probably in other jobs you may not have null value coming from the source.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

If input data has empty spaces, the trim function will trim it and produce null. Based on the padchar property that was set in project level.
If the table columns are not null, the data will not be inserted.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
kondeti
Premium Member
Premium Member
Posts: 67
Joined: Sat Mar 04, 2006 11:38 am

Post by kondeti »

Thnaks for your valuable input.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

As Ray mentioned, if you got your problem solved, drop a word on how you manage to do it. So that it helps the other searchers.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Is Field002 able to carry nulls? If so derive it as

Code: Select all

If IsNull(InLink.Field002) Then SetNull() Else TrimLeadingTrailing(InLink.Field002)
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