Error while reading a csv file

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
somarowthu
Participant
Posts: 1
Joined: Wed Dec 29, 2004 2:26 pm

Error while reading a csv file

Post by somarowthu »

Hi Guys,

I have a routine which breaks a file in to two.
When i run the routine it says "error reading file".
On further investigation i found that there are two empty strings in the middle of the data file which is thowing this error........

Please have a look at the code below

Code:

******* Skip first few records to get to get to the column headings
skip=@true
Loop While skip
ReadSeq Rec from File
Then
Irec=Field(iRec,',',1,4)
If Irec='Date,Site,Placement,Name' Then
skip=@false
End
End
Else
Call DSLogFatal("Error reading file...":Arg1,"JobControl")
GoTo ErrorExit
End
Repeat
***************************************************

so in between the data there are two empty strings with out the delimiters.
I am not able to figure out how to skip those two lines.....
If some body has any idea how to read those lines so that i can skip them,..


Thanks in advance
S
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Code: Select all

If Trim(Rec) <= " " Then Continue
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply