Date and Decimal format in CSV 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
irshanuddin
Participant
Posts: 44
Joined: Wed May 27, 2009 3:01 pm

Date and Decimal format in CSV Output

Post by irshanuddin »

Hello,

I am reading from Netezza and writing to a sequential file in csv format.
I would like to have the dates output as mm/dd/yyyy and the decimals output as 000.00.
I tried setting the format of the date in the format tab as '%mm/%dd/%yyyy'. The output is in fact mm/dd/yyyy but when the month and date are single digits, it drops the leading zeros which I need to provide in the output.
Same goes for the decimal fields. When the number has a scale it outputs fine, but I would like '.00' even for whole numbers.

I was able to output in desired formats for both the date and decimal by simply enclosing in single quotes and setting data type as varchar but the quotes output as well.

Any suggestions?
Thanks!
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Isn't there an option in the sequential file output to say what kind of quotes to use on string fields, including 'none'?
-craig

"You can never have too many knives" -- Logan Nine Fingers
irshanuddin
Participant
Posts: 44
Joined: Wed May 27, 2009 3:01 pm

Post by irshanuddin »

Thanks Craig,
I did try that option, and it still outputs the fields with the single quotes around the values.
Post Reply