Page 1 of 2

Warning :Missing record delimiter "\n", saw EOF in

Posted: Mon Feb 16, 2009 10:06 pm
by pradkumar
Hi,

I have searched the forum before posting this message and have tried all the options suggested. But still unable to remove the warning.

Iam loading data from a sequential file to a table . The format of the file i have put is

Record Levl:
Final Delimeter :End/None

Field Defaults:

Delimeter : |
Quote: None

The warning messages are
Sequential_File_8,0: Missing record delimiter "\n", saw EOF instead

Sequential_File_8,0: Import warning at record 442.

Sequential_File_8,0: Import complete; 442 records imported successfully, 1 rejected.

But seems source has 442 records and all the records are laoding into the target table . I dont understand "1 rejected."

Sample data :
45:30PM|2/12/2009 5:45:30PM|50|28|walmart|500 MAIN STREET |PA|15106^M

The file has ^M at the ending of each record and also for last record.

Anyone please let me know what changes i have to make in the format tab of sequential stage and how to avoid the warning messages?
Can i ignore this warning.

Thanks in Advace

Posted: Mon Feb 16, 2009 10:55 pm
by Sreenivasulu
Hi

You get Control M characters if you create a file in text editors (E.g text editors other than notepad in Windows) and import the file to unix.


Regards
Sreeni :)

Posted: Mon Feb 16, 2009 11:27 pm
by nirdesh2
Just press 'Enter' at the end of the File.

Posted: Mon Feb 16, 2009 11:42 pm
by pradkumar
Thanks for your replys.

But you know iam pulling the file through an automated script and placing it on datastage server . And further using in a job.. So how can do this..

I would really appreciate your help..


Thanks

Posted: Tue Feb 17, 2009 12:49 am
by Kryt0n
pradkumar wrote:Thanks for your replys.

But you know iam pulling the file through an automated script and placing it on datastage server . And further using in a job.. So how can do this..

I would really appreciate your help..


Thanks
Run the file through "od -c" and see if there is a newline on the last line

If it is all good, maybe suppress the warning with a message handler?

As for the ^M, transfer the file in ASCII mode rather than BINARY

Posted: Tue Feb 17, 2009 4:47 pm
by pradkumar
Hi ,

The output of the command od -c got

0425340 6 T H A V E E | S E A T T L
0425360 E | W A | 9 8 1 1 2 - 5 2 1 1 |
0425400 | | | | | | | |
*
0425440 P r e - R e g i s t e r e d |
0425460 | | | | | | | |
0425500 \r \n \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
0425520 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
*
I dontundertand the format of the file.

Iam using the following script to get file from remote server

\sftp $FtpUser@$RemoteHost <<! 2> $tmpFile
cd $RemoteDir
lcd $Inbox
get ${FileName}*
quit
can i use ascii before the get command?

If i suppress the warning messgaes in dev .. Do i need to do the same thing on test/prod?

Please suggest your answers

Thanks In Advance

Posted: Tue Feb 17, 2009 5:23 pm
by chulett
Yes, you can add an "ascii" command just before the get and it will convert the file to UNIX record terminators during the transfer. Or you can do what you are doing and simply tell DataStage that you're reading a DOS file, one that has CR/LF pairs as record terminators.

As to understanding the format of the "od -c" output, suggest you check the man page.

Posted: Tue Feb 17, 2009 7:55 pm
by Kryt0n
pradkumar wrote:Hi ,

The output of the command od -c got

0425340 6 T H A V E E | S E A T T L
0425360 E | W A | 9 8 1 1 2 - 5 2 1 1 |
0425400 | | | | | | | |
*
0425440 P r e - R e g i s t e r e d |
0425460 | | | | | | | |
0425500 \r \n \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
0425520 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
*
I dontundertand the format of the file.

Thanks In Advance
Are you transferring a Word document or something other than a flat file? I'm assuming it isn't a standard flat file with all the '\0's.

A wild stab in the dark would suggest DS thinks you still have records left but because it has hit a \0, it is reading the end of the file.

As a test, you could try opening the document, copy the data out and paste in to a new text file (ensure the last line has an end of line marker) and run that through.

Posted: Tue Feb 17, 2009 9:02 pm
by pradkumar
Hi

Iam pulling a file through sftp from a VMS remote system to datastage Unix server.

I have tried in the sftp script to pull the file using ascii mode but still the file has got control M characters on unix box.And when i run the datastage job to load in to table all the records are loading but with warnings
Sequential_File_8,0: Missing record delimiter "\n", saw EOF instead
Sequential_File_8,0: Import warning at record 454.
Sequential_File_8,0: Import unsuccessful at record 454.

And also i have tried different options like dos format , unix new line under format tab of sequential stage.But unsuccesfull in avoding the warnings.

Please throw anyother options i have to try ..

Thanks in Advance

Posted: Tue Feb 17, 2009 9:43 pm
by ray.wurlod
What happens if you specify null field value property as 000 ?

Re: Warning :Missing record delimiter "\n", saw EO

Posted: Wed Feb 18, 2009 12:01 am
by kailas
Hi ,

Try with the given below format. It should work .

Record Lavel
Final delimeter=End
Record delimiter string=DOS format

Field Default
delimiter string=|
Null Filed value=' '
quote= none

kj

Posted: Wed Feb 18, 2009 12:13 am
by Scope
Try below unix command to remove the Control-M Character from a file

perl -pi -e 's/\r//g;' filename

Posted: Wed Feb 18, 2009 1:53 am
by kailas
Control-M indicates the file is in dos(\\r\\n) format so one must use the following format ..

Record Lavel
Final delimeter=End
Record delimiter string=DOS format


kj

Posted: Wed Feb 18, 2009 3:12 pm
by pradkumar
Hi Everyone,

I have tried all the option you have said .. But still not able to avoid the warnings..

I have tried by putting the NULL Filed value as '000' .

Is there any way can we set in sequential file stage format tab to avoid the warnings rather than removing the control M characters from command line??

Thanks in Advance

Posted: Mon Mar 23, 2009 11:59 pm
by siauchun84
Can I know the column type you are using in the job for the last column before the next line?