I've a physical file with single field (64 chars long) and want to transfer it across to our Unix system using FTP. When I transfer the file across, I don't get CR/LF characters at the end of each record. All physical file records appear in a single line.
If I retrieve the same file from my PC using FTP, its fine and I find all physical file records in line after another.
Why is it not doing the same when I transfer from iseries to Unix box. What am I doing wrong here?
Hi Martin,
It doesn't seem to like "STRUCT R" command when FTPing to a Unix box. I get the following error.
504 Unimplemented STRU type.
It works fine when connected to another iSeries machine.
Any help on this is much appreciated.
Thanks.
I must admit I'm a little confused. Normally this type of problem surfaces when sending from Unix rather than to Unix.
Windows uses the combination of carriage return and line feed to represent end of record, while Unix uses only the line feed. To help address this difference FTP defines that when moving files in ASCII mode that both carriage return and line feed are used, with the platform implementations then adding or removing these controls as necessary when working with the local file system. Are you using ASCII mode? If so, how are you "looking" at the Unix file? You should not find a carriage return, nor should you need one for processing of the file.
Hope this helps,
Bruce Vining
If you google 'UNIX windows carriage return' you will find various ways to convert the Unix file to a windows format (and that this is a fairly common problem...). But do you need to? Are you simply viewing the file from Windows to verify the contents and planning to process the file in a UNIX application? If so, you're probably ready to go. The verification isn't working due to the lack of a carriage return, but a UNIX application isn't going to need it anyway.
Context/ is a nice editor that can view/edit files that do not have CR/LF like you are describing. It has some good language highlighters. The feature I like the most is being able to mark/edit columns in a text file. Not a lot of editors can do that.
Just a note that if you use Wordpad to view the file that is in a UNIX format it will be displayed correctly. Notepad will not display the file correctly as it expect the line terminator to be <CR><LF>.
Frazer Dixon
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!
Discuss This Question: 6  Replies