Losing leading Zeroes

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
EJRoufs
Participant
Posts: 73
Joined: Tue Aug 19, 2003 2:12 pm
Location: USA

Losing leading Zeroes

Post by EJRoufs »

We are pulling a comma-delimited file off of the mainframe, onto a server. The file has character fields with numbers like "06". These are in quotations, as they are character fields, not numeric. When DataStage pulls them in, though, it is treating them as numbers, and dropping the leading zeroes, despite the fact that they are defined as characters throughout the entire process.
I'm guessing there is probably a way to add leading zeroes back on, but we'd prefer not to do that. We may have a "06" that we want to remain a "06" despite the fact that the field may be defined as CHAR(3) (in other words, we don't want "006"). We want to make sure we retain the original data off of the mainframe.

Any ideas/help would be greatly appreciated. Thanks! :>
Eric
ketfos
Participant
Posts: 562
Joined: Mon May 03, 2004 8:58 pm
Location: san francisco
Contact:

Post by ketfos »

Hi,
When you are transformoring the input mainframe file, is output a flat file or database table?

Ketfos
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Check the quote character in your Format tab on the Sequential File stage. If this is set, and missing from the data, then unquoted strings are treated as numeric. (These are the CSV "rules", if you like.)

Change the quote character to 000 and try it again.

Also, make sure that the data type is set correctly in the Sequential File stage output link's Columns grid, and that you're not using Number as the data element.
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