Groups | Blog | Home
all groups > iis ftp > june 2004 >

iis ftp : FTP GET from MVS, using Win2000 server


sonofmog NO[at]SPAM hotmail.com
6/25/2004 1:15:54 PM
I want to perform a get from MVS.
The FTP server is Win2000 server.
The files are ascii text and need to be converted into ebcdic.
The option 'ASCII' in ftp works, but the resulting file contains invalid
characters. Also, every character is preceeded by a blank.

Someone have an idea how to set a correct transfer?
I know that a PUT from Windows works fine, but I do want to perform a get from MVS.

Thank you for your help.

Alun Jones [MSFT]
6/25/2004 1:38:58 PM
[quoted text, click to view]

That sounds more like your file is in Unicode text, not ASCII text.

For instance, a hex dump of the first few bytes of a big-endian Unicode text
file containing the word "flugelhorn" is as follows:

13EA:0100 FE FF 00 66 00 6C 00 75-00 67 00 65 00 6C 00 68
....f.l.u.g.e.l.h

And here's the same file, saved as little-endian Unicode:

13EA:0100 FF FE 66 00 6C 00 75 00-67 00 65 00 6C 00 68 00
...f.l.u.g.e.l.h.

For variety, here's what happens when I save it as UTF-8:

13EA:0100 EF BB BF 66 6C 75 67 65-6C 68 6F 72 6E ...flugelhorn

And now, as ANSI:

13EA:0100 66 6C 75 67 65 6C 68 6F-72 6E flugelhorn

[quoted text, click to view]
from MVS.

First, verify that the file you are trying to retrieve is purely ASCII.

Do you have a hex editor or some other tool you could use on the Windows
machine to look at the contents of the original file?

Alun.
~~~~

jeff.nospam NO[at]SPAM zina.com
6/26/2004 2:08:45 PM
[quoted text, click to view]

You'll need to convert from EBCDIC to ADCII. You could do this in MVS
or transfer and do the conversion on the Windows side, but the file
conversion isn't a part of FTP.

sergeb_ NO[at]SPAM hotmail.com
6/28/2004 7:22:00 AM
Hi Alun, thanks for your help.
You were right, I made the file using notepad for my test. That's the
problem.
I've made a new one using a straight editor and the 00 characters are
gone.
However, my file has 3 lines that are transfered on MVS as a single
line with a 0D separator. I recognise the 0D as a line feed. Is there
a way to make it disappear and instead make FTP treat it as a new
line?

Thanks,
alunj NO[at]SPAM online.microsoft.com (
6/28/2004 4:28:49 PM
[quoted text, click to view]

I think you'll find this, too, is due to your editor.

In Windows, the default line-end marker is 0D0A - that's two characters, a
carriage-return and a line-feed.

In Unix, the line-end marker is 0A. On the Macintosh it's 0D. I would
have to use a lookup table to see what it is in EBCDIC.

Check that your line-end markers are correct in the Windows file, using the
same sort of hex editor you've used on the previous problem. Then, make
sure that the FTP client on MVS is told to use the ASCII file type for the
transfer. This is an instruction to both client _and_ server, to indicate
that they should transfer the file using ASCII characters, and with a
line-end marker of 0D0A. This is, essentially, a no-op to the Windows FTP
server, but the MVS client should pick up on this hint to turn incoming
0D0A sequences into whatever MVS uses for local line-end markers, and if
necessary, to translate into EBCDIC.

Alun.
~~~~
AddThis Social Bookmark Button