NULL values in the output

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
saini
Participant
Posts: 18
Joined: Sat Jan 13, 2007 12:01 am

NULL values in the output

Post by saini »

Hi,

I am fetching col1,col2,col3 from database. In the database col1 and col2 aur not-nullable but when I import the metadata in DS it says these fields are nullable and when I try to write these coloums in a seq file along with the col value its inserting nulls(|) also in the flat file.

The datatype of col1 and col2 are char20.

INPUT

col1 col2
ABC XYZ


OUTPUT

col1 col2
ABC|||||||||||| XYZ||||||||||

I am getting '|' along with the output of the column.
I have tried handling the null values and making the coloums as nullable and not-nullable both ways but not able to remove the '|||'
Please suggest.
OddJob
Participant
Posts: 163
Joined: Tue Feb 28, 2006 5:00 am
Location: Sheffield, UK

Post by OddJob »

I suspect this is because of your value for APT_STRING_PADCHAR. For a default install this will be set to NULL (0x00 in hex).

Add this variable to your job parameters and set to 0x20 i.e. space.

It may be helpful then to convert to a varchar in a transformer and perform a trim on the fields to remove (and keep removed) the trailing spaces.

Hope this helps!
saini
Participant
Posts: 18
Joined: Sat Jan 13, 2007 12:01 am

Post by saini »

Thanks it worked
Post Reply