Leading & trailing zero's in column export stage

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
Aquilis
Participant
Posts: 204
Joined: Thu Apr 05, 2007 4:54 am
Location: Bangalore
Contact:

Leading & trailing zero's in column export stage

Post by Aquilis »

Hi
I am capturing database rejections by adding reject link to oracle connector stage. At the other end am restructuring the same rejects as tab separated values through Column Export stage and writing them into a single column. My Job is RCP enabled. Since few columns have Decimal datatype in the Oracle database and upon any database rejections, decimal values are getting rejected with leading & trailing zero's into it.

Is there any property in Column Export stage which removes leading & trailing zeros and put's only actual decimal value. currently using Default decimal precision & scale [38,10]

eg:
If am inserting any value "44.00" into database, and rejection happens due to key violation , am getting value as
"0000000000000000000000000044.0000000000".

Can any body help.
Aquilis
abhilashnair
Participant
Posts: 284
Joined: Fri Oct 13, 2006 4:31 am

Post by abhilashnair »

If you have a sequential file, which is storing your rejects, then DataStage will always add leading zeroes to decimal values.

You may need to have a transformer before the column export stage and then convert the decimal value input into string and pass on the output as Varchar data type. The function to be used in transformer is

DecimalToString(YourColumn,"fix_zero suppress_zero")
Aquilis
Participant
Posts: 204
Joined: Thu Apr 05, 2007 4:54 am
Location: Bangalore
Contact:

Post by Aquilis »

My Job is RCP Enabled. I don't have a defined metadata before Column export stage. !!!
Aquilis
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Don't worry about it. That's now the Decimal number is displayed. It's not stored like that in a database table; it's stored in a binary format. The display format will be used if the decimal is converted to a string (e.g. for export) but, if that's the case, you can trim the leading and trailing zero characters.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Aquilis
Participant
Posts: 204
Joined: Thu Apr 05, 2007 4:54 am
Location: Bangalore
Contact:

Post by Aquilis »

Yes, In actual tables it's loading correctly.
But when any records get's rejected, All the column data will get inserted into a single column of reject table as tab separated value through Column Export stage.

In the same tab separated value column , leading & trailing values getting inserted for decimal data.
Aquilis
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Correct. Read my earlier response again.
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