Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

FTP from unix to Mainframe - change LF to CRLF

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
jerryte

Active User


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

PostPosted: Thu Dec 19, 2013 11:19 pm    Post subject: FTP from unix to Mainframe - change LF to CRLF
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

Site Director


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

PostPosted: Fri Dec 20, 2013 12:57 am    Post subject:
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 User


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

PostPosted: Fri Dec 20, 2013 1:07 am    Post subject:
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

Site Director


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

PostPosted: Fri Dec 20, 2013 1:10 am    Post subject:
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

Moderator Team Head


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

PostPosted: Fri Dec 20, 2013 3:26 am    Post subject: Reply to: FTP from unix to Mainframe - change LF to CRLF
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    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Urgent Mainframe Requirments (2-10 yr... Shankar779 Mainframe Jobs 0 Sun Nov 27, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Mainframe Developer requirement in Ku... capricorn Mainframe Jobs 0 Sun Oct 23, 2016 3:49 pm
No new posts Interface from Mainframe to Confluenc... hblun CLIST & REXX 4 Tue Sep 20, 2016 5:47 pm
This topic is locked: you cannot edit posts or make replies. Mainframe Admin Openings with CTS enikhilk Mainframe Jobs 0 Tue Sep 13, 2016 10:13 am
No new posts Cards mainframe developer requirement... capricorn Mainframe Jobs 0 Sun Sep 11, 2016 9:57 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us