IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

FTP from unix to Mainframe - change LF to CRLF


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jerryte

Active User


Joined: 29 Oct 2010
Posts: 195
Location: Toronto, ON, Canada

PostPosted: Thu Dec 19, 2013 11:19 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19245
Location: Inside the Matrix

PostPosted: Fri Dec 20, 2013 12:57 am
Reply with quote

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
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 883
Location: The Universe

PostPosted: Fri Dec 20, 2013 1:07 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19245
Location: Inside the Matrix

PostPosted: Fri Dec 20, 2013 1:10 am
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4650
Location: Raleigh, NC, USA

PostPosted: Fri Dec 20, 2013 3:26 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Prod parallel execution on mainframe ... CICS 0
No new posts Mainframe batch Job or REXX to get VT... CLIST & REXX 7
No new posts Mainframe developers 3 - 6 years exp Mainframe Jobs 0
No new posts Looking for mainframe developers Mainframe Jobs 0
No new posts Looking for mainframe system programmers Mainframe Jobs 0
Search our Forums:

Back to Top