Incorrect allignment while generating CSV file using DS job.

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
ramakrishna459
Participant
Posts: 37
Joined: Tue Mar 26, 2013 12:02 pm
Location: INDIA

Incorrect allignment while generating CSV file using DS job.

Post by ramakrishna459 »

Hi all,

we are getting incorrect allignment for the few rows in csv file when generating using sequential file.

Format settings are delimeter as comma, quotes as double.

77° - 9° 10",R0403"
77° - 9° 10",R0403"
77° - 9° 10",R0403"
77° - 9° 10",R0403"
77° - 9° 10",R0403"
77° - 9° 10",R0403"
77° - 9° 10",R0403"

the above two columns are comming in single column instead of two columns.
crystal_pup
Participant
Posts: 62
Joined: Thu Feb 08, 2007 6:01 am
Location: Pune

Post by crystal_pup »

It appears that there are special characters in the data that is being written to the target sequential file. Can you try removing the columns ( the ones that have special characters "°") and re-run the job and verify if the issue still persists. If the issue disappears, then you might have to somehow take care of the special characters and reintroduce the dropped columns in the target sequential file.

Note - I have assumed that your target is a sequential file stage.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What should you be getting, and what format settings are you using?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ramakrishna459
Participant
Posts: 37
Joined: Tue Mar 26, 2013 12:02 pm
Location: INDIA

Post by ramakrishna459 »

ray.wurlod wrote:What should you be getting, and what format settings are you using? ...
Actualy 77° - 9° 10 should come in seperate column and R0403 should come in another column.
Am using sequential file format settings for varchar columns using quote as double and delimeter as comma.

is there any way to change the settingsin sequential file to fix this issue.
prasson_ibm
Premium Member
Premium Member
Posts: 536
Joined: Thu Oct 11, 2007 1:48 am
Location: Bangalore

Post by prasson_ibm »

Your file is probably not in a correct format.

According to your definition given in sequential file (Delimiter=Comma and Quote=Double) your result should go to same column.

Your correct format is :-

Code: Select all

"77° - 9° 10","R0403" 
Remove quote=double and see what is your result.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or read it as a single field, strip out the double quotes and then let a Column Export stage create the two fields.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Each field is missing its opening quote. Have a severe talk with the data provider.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
srinivas.nettalam
Participant
Posts: 134
Joined: Tue Jun 15, 2010 2:10 am
Location: Bangalore

Post by srinivas.nettalam »

As Ray suggested first step is to talk to the data provider if that is possible
OR
Read as a single column ,pass that to a stage variable, strip out the " from the stage variable and use field function on the stage variable in the derivation for columns.
N.Srinivas
India.
Post Reply