Loading csv , Last Column, String Function (Trim/Left)

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
imfarhan
Participant
Posts: 53
Joined: Tue Jul 24, 2012 9:34 am

Loading csv , Last Column, String Function (Trim/Left)

Post by imfarhan »

Hi All,

I have a small csv file, It loading successfully into my target table.
However, the last column which keeps only flag values "Yes" or "No" and some are nulls

When I look into target Table (DB2) it show like: No□ Yes□
Those square boxes showing don't know why?
I thought no carriage return at the end of the row but I tried still showing

Please advise?

I tried to tacke using Trim (Field, " ","A") or TRim(Field,"","T") or Trim(Field)

Regards
Farhan
Farhan Syed
imfarhan
Participant
Posts: 53
Joined: Tue Jul 24, 2012 9:34 am

Re: Loading csv , Last Column, String Function (Trim/Left)

Post by imfarhan »

Found the function

Code: Select all

Left(Field,Len(Field)-1)
Thanks for the help
Regards
F
Farhan Syed
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Do you understand why your Trim examples didn't work?
-craig

"You can never have too many knives" -- Logan Nine Fingers
chandra.shekhar@tcs.com
Premium Member
Premium Member
Posts: 353
Joined: Mon Jan 17, 2011 5:03 am
Location: Mumbai, India

Post by chandra.shekhar@tcs.com »

If I were you, I will never do that untill I find out the exact cause for it.
Just manipulating your data according to your need is not a correct practice.
First you need to find out that why the square boxes were showing up in your data ? Was it due to the file or due to datatype(CHAR) ?
E.g If you get Yes as one of the incoming value then according to your formula Ye will go to the target.
As a good datastage developer try to think from a broader perspect, then only after finding the root cause, build your logic.
Thanx and Regards,
ETL User
imfarhan
Participant
Posts: 53
Joined: Tue Jul 24, 2012 9:34 am

Post by imfarhan »

I've a feeling its becaue last column and its carriage return may be.
Do you thik I can handle this problem using field properties of my SEQUENTIAL load file under the "Edit-Column-Metadata" field properties?

May be I can handle throught Delimiter properties. I will try if its work I will take off the function . thanks for your input and suggestions

Regards
Farhan
Farhan Syed
Post Reply