Hi All,
I am having trouble putting double quotes around a field when writing to a sequential file when the field contains a comma. The file itself is a CSV. So if the field does not contain a comma within it, it shouldn't be enclosed within double quotes, but when the field does contain a comma, it should be.
Thanks in advance.
Put quotes around fields in sequential file only with commas
Moderators: chulett, rschirm, roy
Put quotes around fields in sequential file only with commas
Jweir
--- If strength were all, tiger would not fear scorpion.
--- If strength were all, tiger would not fear scorpion.
So... this is a DataStage question? As in you're having this issue with the Sequential File stage in a parallel job? Just wanted to double-check since the question was pretty generic. In any case, I am wondering why you are worried about the quotes, specifically the need to only have them when there's a comma in the data. Would having them there all the time cause a problem? It doesn't really seem like something to me that you should be worried about.
The only other clarification would be the "contains a comma" statement. Not could contain but actually does contain, as in a record by record check of the actual data? One record might have quotes around field X while the next record may not, in other words. Perhaps over-thinking things a bit this morning but looking to define the scope of the issue if we move forward with it.
The only other clarification would be the "contains a comma" statement. Not could contain but actually does contain, as in a record by record check of the actual data? One record might have quotes around field X while the next record may not, in other words. Perhaps over-thinking things a bit this morning but looking to define the scope of the issue if we move forward with it.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Question/scenario makes the brain to wander a little bit! In future, putting some sample input and expected output will help.
Is this your clarification on when the quotes will be put by DataStage. Are you creating the file by using SeqFile stage in which you will get quotes for all fields and not face the particular issue which you explained?
Is this your clarification on when the quotes will be put by DataStage. Are you creating the file by using SeqFile stage in which you will get quotes for all fields and not face the particular issue which you explained?