Sequential File CSV File format

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
imfarhan
Participant
Posts: 53
Joined: Tue Jul 24, 2012 9:34 am

Sequential File CSV File format

Post by imfarhan »

Hi All ,

Some of the rows from my Sequential file (csv) are rejecting. The reason CR/LF within the field.

Do you think I can handle this problem by setting up the right properties/format parameter on Format|Record_level.

If it LineFeed (LF) I could handle them by using

Code: Select all

Properies|format (Record delimeterstring = DOS Format) 
But within a line are two CR/LF(CariageReturn/LineFeed).
However, each column/field are double quotes and field delimiter within comma i.e. "aaa","bbbb"

From the following example the 1st row ok but (2,2b) rejecting during load
When I open the file in Notepad++ it show two CR/LF(CarriageReturn/LineFeed) on row 2,2b as shown below:

Code: Select all

"106.5","18.1","15.96","Logmar",,"No",,"Yes",,"Farhan" 
"110.3","21","17.26","Logmar
Refer to Optician.",,"No",,"Farhan"    

Code: Select all

1--> "106.5","18.1","15.96","Logmar",,"No",,"Yes",,"Farhan" CR|LF
2--> "110.3","21","17.26","Logmar   CR|LF
2b-> Refer to Optician.",,"No",,"Farhan"    CR|LF
Note: From above Example : CR|LF is not the value its show the row qualifier (CarriageReturn/Line Feed
From the above example (2) and (2b) rows should be one row like (1)

The properites I tried on Format tab for "RecordLevel" are:

Code: Select all

Final delimeter = null
Record delimeter = UNIX newline
or

Code: Select all

Final delimeter String "Farhan"
hope make sense appreciate your help in advance
Kind regards,
Farhan
Last edited by imfarhan on Fri May 02, 2014 5:59 am, edited 2 times in total.
Farhan Syed
imfarhan
Participant
Posts: 53
Joined: Tue Jul 24, 2012 9:34 am

Post by imfarhan »

so looking the data can build the logic as last column values can pass on "Record_Delimeter_String" = \" \r \ n

Code: Select all

Record Delimiter String = \" \r \n
Final Delimiter = end
Does not work

When I use folllowing condition

Code: Select all

Record Delimiter String = \r \n
Final Delimiter = end
It view only row 1 not the 2nd row which I would like to view as well

:cry:
Farhan Syed
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

Try using the sequential file stage line terminator setting in a server job.
Choose a job you love, and you will never have to work a day in your life. - Confucius
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It is more forgiving of things like that when configured properly. A Server Shared Container in your PX job could be leveraged as well to run just that stage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
imfarhan
Participant
Posts: 53
Joined: Tue Jul 24, 2012 9:34 am

Source Data Rejecting coz of Data row keep CR/L

Post by imfarhan »

Hi Eric,

Sorry for late reply Thanks Eric for your response.
I've tried on Server job by creating a row keep CR/LF middle of the column/field and I think it was working

However, I've requested to Data provider to correct from their end, so I don't need to handle it at my side.

I'm sure there must be a way to handle this exception on Parallel job?
Thanks again for your help.
Kind regards
F
Farhan Syed
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

As Craig menioned above, a Server Shared Container can be used within your parallel job. It may be a good idea to use that method to continue to check for the situation whether or not the data provider agrees.
Choose a job you love, and you will never have to work a day in your life. - Confucius
Post Reply