Page 1 of 1

Losing leading Zeroes

Posted: Fri Jul 16, 2004 12:47 pm
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! :>

Posted: Fri Jul 16, 2004 2:53 pm
by ketfos
Hi,
When you are transformoring the input mainframe file, is output a flat file or database table?

Ketfos

Posted: Fri Jul 16, 2004 4:52 pm
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.