View previous topic :: View next topic
|
Author |
Message |
jerryte
Active User
Joined: 29 Oct 2010 Posts: 202 Location: Toronto, ON, Canada
|
|
|
|
I am running an FTP client program on z/OS mainframe to to a GET from a unix server. Since unix ends each line with just a LF the ftp program doesn't recognize this. It wants CRLF.
Is there a ftp subcommand to tell unix ftp server to append CRLF to end of each line? I have searched on google and forums and the FTP manual but no luck. Thanks |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Jerry,
Suggest you try to preallocate the mainframe dataset to include the Unix control character. Long ago we did this and ignored the extra character that ended each record.
Hopefully, that would still work. We did this in the mid-90's. |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
You have two incorrect ideas here- Mainframe data sets do not use CR/LF to terminate a logical line like Windoze. Lines are terminated by the logical record length (for fixed length records) or a length specified in the record's RDW for variable length records.
- When you use FTP to transmit text (not binary) data from Unix to Windoze, the FTP in Windows converts NL data to CR/LF. Similarly, when you use FTP to transmit text data from Unix to a mainframe data set, FTP removes the NL and terminates the logical record using mainframe rules.
When IBM defined the file systems for System/360, they looked at prior art, and decided the use of embedded control characters as was done with the 14xx line of machines was a bad idea and they did away with the whole rotten idea. It's a pity the desgners of Unix, in an effort to toss out bad ideas in OS/360, didn't realize that OS/360 had one most excellent good idea and retained it. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
To add a little - i suspect the received data stair-steps when viewed. This is because of the not used/needed control characters.
Also, if you don't want to pre-allocate, the dcb info can be set in the FTP session. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Does the Unix box have "unix2dos" avaiable:
unix2dos [ -ascii ] [ -iso ] [ -7 ] originalfile convertedfile
the -ascii option converts the data to Carriage-Return/Line-Feed. |
|
Back to top |
|
|
|