sequential file error

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
deepthi
Participant
Posts: 56
Joined: Thu Apr 28, 2005 9:52 am

sequential file error

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Far simpler to mark the 'First line is column names' option in the stage, it will automatically skip it.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Abburi
Participant
Posts: 31
Joined: Tue May 29, 2007 12:38 pm

Re: sequential file error

Post 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.
Regards,
Abburi
Abburi
Participant
Posts: 31
Joined: Tue May 29, 2007 12:38 pm

Re: sequential file error

Post 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.
Regards,
Abburi
deepthi
Participant
Posts: 56
Joined: Thu Apr 28, 2005 9:52 am

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
developeretl
Participant
Posts: 89
Joined: Sat Jul 24, 2010 11:33 pm

Post 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 ?
arvind_ds
Participant
Posts: 428
Joined: Thu Aug 16, 2007 11:38 pm
Location: Manali

Post 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.
Arvind
GJ_Stage
Participant
Posts: 131
Joined: Mon Oct 27, 2008 6:59 am

Post 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.
Jothi
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or leave off the redirection and use that methodology in the Filter option of the stage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply