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

FTP is insertng cr/lf and removing trailing blanks


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon Aug 27, 2012 9:29 pm
Reply with quote

Hello,

I didn't realize 'til now that the tso/ispf part of the forum is where ftp questions are handled . . .

One of my users stopped by with a situation that they use WS_FTP Pro to download a file to the PC from z/OS and when the file is stored on the pc, trailing blanks are removed and a cr/lf is inserted. Normally this is not a problem for them locally, but when they send this to another organization, the "short" records cause a problem for the receiver. This a is a new process and gthis is the first time thru . . .

Once upon a time i remember being able to specify CRLF or NOCRLF. There was also a SET .... NOCRLF (.... = SITE or LOCSITE?). I also seem to recall a way to specify keeping or deleting trailing spaces.

Their problem is that the code on neither end can be changed, but they still need to get the data downloaded/uploaded.

Anyone remember what i've forgotten or has this been another imaginary memory from long ago? I've not actually set up any new transfer processes for any users for quite a while. What i need to do most days, is just use whatever ftp is on the box i'm using and it tends to work icon_rolleyes.gif

I did try to send the data as an external attachment to an e-mail (XMITIP), but the record length is greater than smtp allows. Interestingly, XMITIP did show the "chopped" length.

Thanks,

d
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Mon Aug 27, 2012 9:58 pm
Reply with quote

Specify
Code:
SITE TRAILINGBLANKS
to turn off the behavior. You might need
Code:
QUOTE LOCSITE TRAILINGBLANKS
if the z/OS machine is the client.

SBSENDEOL is the option to control whether LF, CR, CRLR, or NONE is sent for line terminators.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2546
Location: Silicon Valley

PostPosted: Mon Aug 27, 2012 10:06 pm
Reply with quote

Try using XMIT with the OUTDSN parameter and then downloading the outdsn as a binary file.

You cannot use the file on the PC, but it useful when the transfer is z/OS -> windows -> z/OS.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Mon Aug 27, 2012 10:58 pm
Reply with quote

I have seen workarounds that use "fixed variable" format. You create the host data set as VB, but you ensure that each record is padded to its maximum allowable length. Some file transfer tools (I don't recall which ones) can interpret the RDW and insure that the receiving file ends up with the same record length as the original data set. ibmmainframes.com/viewtopic.php?t=27825
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Aug 28, 2012 7:06 pm
Reply with quote

Hello,

Thanks for the replies.

So far, no progress . . . icon_sad.gif

A bit more info:
The "piece in the middle" is Windows-7 where the client runs to pull from the mainframe ftp server.

Found that an out-of-date of WS_FTP has been installed. Talked with the people at Ipswitch and found that the version being used is not (and was never) intended to run on Win-7. There are Many deocumented issues.

So, i'm trying to use the ftp available at the command prompt.
SITE TRAILINGBLANKS is an "invalid command" as is SITE or "SITE ?"
SBSENDEOL {whatever} returns the same.

Quote:
then downloading the outdsn as a binary file.
You cannot use the file on the PC, but it useful when the transfer is z/OS -> windows -> z/OS.
When working, this process will download the file from a mainframe, then (changing to a secure ftp client) will upload the file to a UNIX system.

Quote:
You create the host data set as VB . . .
The file is created by a remote system that will not even talk about changing the file (seems like this file is sent thousands of places and they do not entertan creating custom versions as they do not want the maintenance).

Internally, the IT people here do not want to "touch" the file, merely receive it and send it along. I'd prefer the UNIX system get it from the mainframe directly, but due to contracts, they are not allowed. By contract, we are allowed to download and the UNIX system has a contract that we send them this data. Such fun . . . icon_wink.gif

I'm working on getting an upgrade to the ftp product but that often does not happen overnight . . .

I'm also continuing to experiment here and will post an update if i learn anything.

Thanks for the help.

d
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Aug 28, 2012 7:36 pm
Reply with quote

Try
Code:
QUOTE SITE TRAILINGBLANKS SBSENDEOL ...
the QUOTE lets the PC pass the SITE command to the z/OS system.
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Tue Aug 28, 2012 7:56 pm
Reply with quote

In the meantime, to get your stuff done, can you change the mainframe blanks to some other unused value and then reconvert whatever that maps to to ascii blanks after the xmit?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Aug 28, 2012 9:19 pm
Reply with quote

Hello,

Thanks for the thought Phil, but the user is not willing to "touch" the file at all. To do this, the mainframe file would have to be "changed" as well as the file after download on the pc.

Robert,
Code:
QUOTE SITE TRAILINGBLANKS SBSENDEOL

Worked Quite well icon_biggrin.gif
'Preciate it!

I'll update if there is anything to tell, but it looks like we're good to go.

d
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Aug 28, 2012 10:01 pm
Reply with quote

Glad to hear it worked.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Apr 18, 2014 1:55 am
Reply with quote

Don't know if this should be a new topic or as it is more FTP related, I left it here. . . I'll be happy to split it if that is better.

With the same set of users, but a different requirement, we now have a multi-gig file that has been sent to our world and the entire file looks like one big record . . . When it is ftp'd to the mainframe it has a record too long issue and will not transfer.

Is there any way I can force the upload to insert a cr/lr every so many characters (record).

Or might I be able to upload this into an OMVS dataset and then manipulate it? Preferably with some standard utility in OMVS/uss.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Fri Apr 18, 2014 2:06 am
Reply with quote

Can you not use LOCSITE LRECL=value?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Fri Apr 18, 2014 2:15 am
Reply with quote

If it was sent as a binary file, you'll need to FTP it to OMVS, then use iconv on it before moving it to z/OS.

If it was sent as a text file, it most likely has Unix (LF) line terminators which won't allow the records to be separated on z/OS when z/OS sees the file coming from a Windows machine. You might be able to determine this by doing a HEX edit (TSO/ISPF for example) on the data set and checking for the LF character (depending on the code page, it will usually be X'15' or X'25') in the record. There's several options that can be used with QUOTE SITE / QUOTE LOCSITE to determine end-of-line behavior; check the manual for the option(s) you need.
Back to top
View user's profile Send private message
James Halley

New User


Joined: 11 Apr 2012
Posts: 18
Location: USA

PostPosted: Mon Apr 21, 2014 10:57 pm
Reply with quote

Yes, this sounds like a Unix-type line terminator issue I last encountered about 15 years ago.

There may be better ways to do it now but I think we used Programmers File Editor (PFE) to convert the file to one acceptable to z/OS.

I still occasionally use PFE on Win7 and see that it can still be downloaded from www.lancaster.ac.uk/~steveb/cpaap/pfe/

Open your file with PFE, select Options ... Current Modes ... Saving. Check or uncheck "Use UNIX convention (LF) for end-of-line" as necessary and then click the "Apply Now" button.

If I remember correctly, your records will then be displayed correctly and you can then do a File ... Save to preserve the new format.

I apologize in advance if I am leading you astray.
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 -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Delete file row if blanks in the firs... DFSORT/ICETOOL 5
No new posts Removing date values lines/records fr... SYNCSORT 2
No new posts Removing Hyphens and Dots using Syncsort SYNCSORT 8
No new posts Related to performing validation of f... DFSORT/ICETOOL 19
No new posts Sort on different fields, removing du... SYNCSORT 8
Search our Forums:

Back to Top