Page 1 of 1

File gets currupt if edited in vi.

Posted: Fri May 19, 2006 12:49 am
by atulghate
I have sequential file landed using datstage. And I am using this file in another job. For testing purpose I had to edit this file once created for one record.

I am just changing one letter. I am doing this using vi.
Once I save this file and try to read this in datstage job i get import error.

However when i do not do any editing file is read okay in next job..

Any clues...

Posted: Fri May 19, 2006 2:06 am
by ArndW
The default line termination for DOS files is <cr><lf>, saving it with vi might change that to the unix <lf> character only.

Posted: Fri May 19, 2006 2:08 am
by ray.wurlod
Umm... don't use vi ?

Examine the file with a hex-capable editor to determine what the line terminator character(s) (if any) are.

What precisely do you mean by "corrupted"? That is, what error do you get? What raw record is sent to the reject link?

Re: File gets currupt if edited in vi.

Posted: Fri May 19, 2006 4:39 am
by Klaus Schaefer
Check if you have written the file with varchars. You might have the option "varchar prefix byte" active. This bytes may get corrupted when using vi.

In this case you better write the file without varchar prefix bytes. Have a look at the schema definition.

Best regards
Klaus

Posted: Fri May 19, 2006 6:55 am
by kumar_s
Pls let us know, what eactly you are trying to change and who exactly you are trying to save the file?
Because I have did the same several time without any issues.