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

FTP from Mainframe to Unix - with CRLF


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

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Thu Mar 23, 2017 5:12 am
Reply with quote

Hi,

We are sending a PS FB LRECL=80 file from Mainframe to a Unix FTP server. Mainframe is the client.
Currently the file has only LF X'OA' and is missing CR X'13' . We would want to have CR+LF on the file.

FTP parms:
Code:
FTP.SERVER
USERID
PASSWORD
ASCII
LOCsite lrecl=80 blksize=27920
LOCSITE SBSENDEOL=CRLF
put 'WELLS.PS.FILE' "wells.txt"
quit


When I tried LOCSITE SBSENDEOL=CR The destination file had neither CR or LF.

I tried QUOTE SITE HELP
Code:
ftp> QUOTE SITE HELP
214- The following SITE commands are recognized (* =>'s unimplemented).
   UMASK           CHMOD           BANDWIDTH       PASV
   IDLE            HELP            KEEPALIVE


Does this mean that only these commands are supported on QUOTE SITE command?

Thanks in advance,
Vasanth.S
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Thu Mar 23, 2017 8:35 am
Reply with quote

QUOTE SITE HELP will tell you what the server SITE command supports -- but when FTP goes from the mainframe to the Unix machine, the mainframe is the client not the server. Did you try QUOTE LOCSITE HELP ?

I suggest using MODE S before the LOCSITE SBSENDEOL CRLF command.
Back to top
View user's profile Send private message
steve-myers

Active Member


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

PostPosted: Fri Mar 24, 2017 10:08 am
Reply with quote

From z/OS V1R13.0 Comm Svr: IP User's Guide and Commands
Quote:
SBSENDEOL
Specifies which end-of-line sequence to use when ENCODING is SBCS, the data transfer type is ASCII, and data is being sent to the server. The following are possible values: ...
Personal opinion: I'm not sure how valuable this is. When you send ASCII data the sending site sends a standard TCPIP defined end of line to the receiving FTP site, which converts this end of line to the standard end of line for the receiving site. If, in fact, the receiving site is Unix, as you claim, inserting the CR LF is just going to confuse things since CR LF is the Windoze end of line; *nix uses a different end of line, particularly if the data is being sent to another site. The manual also suggests this is not universally supported.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Sat Mar 25, 2017 12:37 am
Reply with quote

Thank you both for your thoughts.
Quote:
I suggest using MODE S before the LOCSITE SBSENDEOL CRLF command.

Hi Robert,
Yes I did try MODE S. Still no joy. The file has only LF.

Quote:
*nix uses a different end of line, particularly if the data is being sent to another site.

Yes Steve, that is the problem. The file is FTP'ed to a NAS FTP server which runs Unix. The file is then accessed by multiple people from Windows machines.
So when they view the file in windows the file does not have CR and LF.

I wanted to know if there was a way to force CRLF from the sending side(Mainframe) and accept it as is on the receiving side(Unix).
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Sat Mar 25, 2017 4:00 am
Reply with quote

If you created the dataset with ASCII coding instead of EBCDIC and ensured that the CRLF pair were properly appended then you could transfer the data set in binary mode.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Sat Mar 25, 2017 5:07 am
Reply with quote

I've seen this problem before. I don't recall what the solution(s) were. I know one possibility would be to transfer the data to a Windows server, then to the Unix server (REXEC can help automate this solution) in binary -- which works well as long as there is a Windows server to transfer to.
Back to top
View user's profile Send private message
steve-myers

Active Member


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

PostPosted: Sun Mar 26, 2017 7:50 am
Reply with quote

Nic Clouston wrote:
If you created the dataset with ASCII coding instead of EBCDIC and ensured that the CRLF pair were properly appended then you could transfer the data set in binary mode.

A utility program to transform an EBCDIC data set to an ASCII data set with CR LF as an end of line suitable to send as binary data is relatively easy to write.

If you are interested, send me a PM with an E-mail and I can send you the utility.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Tue Mar 28, 2017 8:41 pm
Reply with quote

Quote:
If you created the dataset with ASCII coding instead of EBCDIC and ensured that the CRLF pair were properly appended then you could transfer the data set in binary mode.

Thanks for the input Nic. I guess I got to do it the hard way.

Quote:
I know one possibility would be to transfer the data to a Windows server, then to the Unix server (REXEC can help automate this solution) in binary

Yes we do this as a work around currently.

Quote:
If you are interested, send me a PM with an E-mail and I can send you the utility.

Thank you Steve.
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 FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Mainframe openings in Techmahnidra fo... Mainframe Jobs 0
No new posts Creating Unix Directory using COBOL i... COBOL Programming 2
No new posts Mainframe Programmer with CICS Skill... Mainframe Jobs 0
No new posts How to Reformat a file using File Man... All Other Mainframe Topics 14
Search our Forums:

Back to Top