25 pts.
 iSeries to Unix FTP problem
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?

Software/Hardware used:
ASKED: February 14, 2008  3:02 PM
UPDATED: November 20, 2008  12:29 AM

Answer Wiki:
Hi, Try the FTP command STRUCT R - This should cause FTP to send the data as records instead of a stream of data. Hope this helps, Martin Gilbert.
Last Wiki Answer Submitted:  February 14, 2008  5:20 pm  by  Gilly400   23,625 pts.
All Answer Wiki Contributors:  Gilly400   23,625 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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.

 25 pts.

 

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

 6,055 pts.

 

Yes, I’m using ASCII mode. I’m looking at the file from my Windows PC. I’ve a drive mapped to our Unix box.

 25 pts.

 

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.

 6,055 pts.

 

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.

 90 pts.

 

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

 10 pts.