Page 1 of 1

sequential file error

Posted: Thu Jan 31, 2008 2:55 pm
by deepthi
Hi
I am trying to remove first line in my input sequential file. i am using filter command sed '1d' to do this.

i am getting error saying

test..Sequential_File_0.DSLink3: ds_seqopen() - Error in filter command "sed -n '1d'" -
test..Sequential_File_0.DSLink3: ds_seqopen() - Error in execv() - No such file or directory

How can i correct this error?

Thanks

Posted: Thu Jan 31, 2008 3:20 pm
by chulett
Far simpler to mark the 'First line is column names' option in the stage, it will automatically skip it.

Re: sequential file error

Posted: Thu Jan 31, 2008 3:21 pm
by Abburi
deepthi wrote:Hi
I am trying to remove first line in my input sequential file. i am using filter command sed '1d' to do this.

i am getting error saying

test..Sequential_File_0.DSLink3: ds_seqopen() - Error in filter command "sed -n '1d'" -
test..Sequential_File_0.DSLink3: ds_seqopen() - Error in execv() - No such file or directory

How can i correct this error?

Thanks

Why filter you can set this in the Sequential File it self, follow below steps:

go to Output tab-->Properties tab-->in the Options, select First Line is Column Names= True, what it means is : if set true, the first line of a file contains column names/row on writing and is ignored on reading.

Re: sequential file error

Posted: Thu Jan 31, 2008 3:23 pm
by Abburi
deepthi wrote:Hi
I am trying to remove first line in my input sequential file. i am using filter command sed '1d' to do this.

i am getting error saying

test..Sequential_File_0.DSLink3: ds_seqopen() - Error in filter command "sed -n '1d'" -
test..Sequential_File_0.DSLink3: ds_seqopen() - Error in execv() - No such file or directory

How can i correct this error?

Thanks

Why filter you can set this in the Sequential File it self, follow below steps:

go to Output tab-->Properties tab-->in the Options, select First Line is Column Names= True, what it means is : if set true, the first line of a file contains column names/row on writing and is ignored on reading.

Posted: Thu Jan 31, 2008 3:27 pm
by deepthi
chulett wrote:Far simpler to mark the 'First line is column names' option in the stage, it will automatically skip it. ...
The second line in the file is column names. the first line will have a string that tells nature of the data in the file like "career" or "institution" so on.

Thanks

Posted: Thu Jan 31, 2008 3:37 pm
by chulett
That would have been good to know. Sounds like you've got the source file wrong - is it fully pathed and spelled correctly? And you'll need to add it to the actual filter command in this case, I do believe.

Posted: Wed Aug 17, 2011 8:42 am
by developeretl
I have the same issue. I have sequential in the source with 2nd line as column name and first line tells about UTF8. I have tried to set the first line as column but it did not work. I have achieved using the sed command but can i handle this in job since i have to use shells scripts for other purpose after the job completes ?

Posted: Wed Aug 17, 2011 8:50 am
by arvind_ds
Another but lengthy solution :?

Try out this.

Go to your UNIX box and count the total number of records in your sequential file.

wc -l FileName

It will give you the total number of lines in that file.

Suppose you get total number of lines = m, then reduce 2 from m.

For example

n = m - 2

Then do this

tail -n FileName > NewFileName

Now Use NewFileName in your datastage job.

Posted: Wed Aug 17, 2011 9:35 am
by GJ_Stage
Try out this:

In Unix server fire the below command or use in ExecSH command in DSJOB properties.

awk ' NR > 2 ' Yourfile_name > NewFilename

use NewFilename for DataStage Job.

Posted: Wed Aug 17, 2011 9:59 am
by chulett
Or leave off the redirection and use that methodology in the Filter option of the stage.