Discussion:
problem with FTP from Windows 10 to z/OS
(too old to reply)
Kevin Merkley
2018-06-01 22:42:05 UTC
Permalink
Raw Message
I'm normally a VM guy but I'm trying to do some work on z/OS 2.2, and I could use some help.
I'm trying to use Windows FTP to transfer a downloaded tersed file from Windows to z/OS 2.2.

Previously, with Windows 7, I invoked FTP with this command: ftp < ftpscript.txt
The ftpscript file normally has quite a few more statements but to verify the problem I condensed it to contain these statements:
-------------------------------
verbose
open nnn.nnn.nnn.nnn
myuser
binary
put file.trs 'MYUSER.FILE.TRS'
quit
-------------------------------
The verbose statement allowed FTP to prompt for a password, in order to avoid having the password in the text file.

Recently, I grudgingly had to upgrade to Windows 10. This process no longer works. In trying to diagnose the problem, I used the FTP -d option and discovered a difference between FTP on Windows 10 and FTP on Windows 7. The Windows 10 FTP client connects to the z/OS FTP server and immediately issues the command: OPTS UTF8 ON
and receives this message:
501 command OPTS aborted -- no options supported for UTF8

It accepts the userid but then processes the binary statement as the password, and of course that fails.

In the manual "z/OS Communications Server: IP Configuration Reference" I found the EXTENSIONS statement to enable FTP to support FTP extensions. The description of EXTENSIONS UTF8 states: "Enables the FTP server to respond to the LANG command, and to use UTF–8 encoding of pathnames on the control connection." So I added EXTENSIONS UTF8 in the TCPIP.FTP.DATA dataset. I cycled the FTP daemon started task, and the TCPIP started task, and even reIPLed the z/OS system. This has not made any difference.

I'm hoping to find the way for z/OS to accept the OPTS UTF8 ON command. (Or for Windows 10 FTP to not issue the command.)

Can someone please give me some guidance on this? I'm at a loss. I've done lots of internet searches and haven't been able to find any solution.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Mike Hochee
2018-06-01 23:58:54 UTC
Permalink
Raw Message
I'm assuming you replaced the '<' redirection parameter, with the -s parameter and continue to have the issue. You might try eliminating the text file and -s parameter altogether, and manually enter the FTP subcommands found in the file. This doc note for the -s parameter is also interesting...

Note: In Windows 8 and Windows Server 2012 or later operating systems, the text file must be written in UTF-8.

So maybe another reason to try it manually.

HTH,
Mike
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of Kevin Merkley
Sent: Friday, June 1, 2018 6:32 PM
To: IBM-***@LISTSERV.UA.EDU
Subject: problem with FTP from Windows 10 to z/OS

I'm normally a VM guy but I'm trying to do some work on z/OS 2.2, and I could use some help.
I'm trying to use Windows FTP to transfer a downloaded tersed file from Windows to z/OS 2.2.

Previously, with Windows 7, I invoked FTP with this command: ftp < ftpscript.txt The ftpscript file normally has quite a few more statements but to verify the problem I condensed it to contain these statements:
-------------------------------
verbose
open nnn.nnn.nnn.nnn
myuser
binary
put file.trs 'MYUSER.FILE.TRS'
quit
-------------------------------
The verbose statement allowed FTP to prompt for a password, in order to avoid having the password in the text file.

Recently, I grudgingly had to upgrade to Windows 10. This process no longer works. In trying to diagnose the problem, I used the FTP -d option and discovered a difference between FTP on Windows 10 and FTP on Windows 7. The Windows 10 FTP client connects to the z/OS FTP server and immediately issues the command: OPTS UTF8 ON and receives this message:
501 command OPTS aborted -- no options supported for UTF8

It accepts the userid but then processes the binary statement as the password, and of course that fails.

In the manual "z/OS Communications Server: IP Configuration Reference" I found the EXTENSIONS statement to enable FTP to support FTP extensions. The description of EXTENSIONS UTF8 states: "Enables the FTP server to respond to the LANG command, and to use UTF–8 encoding of pathnames on the control connection." So I added EXTENSIONS UTF8 in the TCPIP.FTP.DATA dataset. I cycled the FTP daemon started task, and the TCPIP started task, and even reIPLed the z/OS system. This has not made any difference.

I'm hoping to find the way for z/OS to accept the OPTS UTF8 ON command. (Or for Windows 10 FTP to not issue the command.)

Can someone please give me some guidance on this? I'm at a loss. I've done lots of internet searches and haven't been able to find any solution.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Steve Horein
2018-06-02 00:10:58 UTC
Permalink
Raw Message
Maybe add -n?

C:\>ftp /?

Transfers files to and from a computer running an FTP server service
(sometimes called a daemon). Ftp can be used interactively.

FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-A] [-x:sendbuffer]
[-r:recvbuffer] [-b:asyncbuffers] [-w:windowsize] [host]

-v Suppresses display of remote server responses.
-n Suppresses auto-login upon initial connection.
-i Turns off interactive prompting during multiple file
transfers.
-d Enables debugging.
-g Disables filename globbing (see GLOB command).
-s:filename Specifies a text file containing FTP commands; the
commands will automatically run after FTP starts.
-a Use any local interface when binding data connection.
-A login as anonymous.
-x:send sockbuf Overrides the default SO_SNDBUF size of 8192.
-r:recv sockbuf Overrides the default SO_RCVBUF size of 8192.
-b:async count Overrides the default async count of 3
-w:windowsize Overrides the default transfer buffer size of 65535.
host Specifies the host name or IP address of the remote
host to connect to.

Notes:
- mget and mput commands take y/n/q for yes/no/quit.
- Use Control-C to abort commands.

C:\>
Post by Kevin Merkley
I'm normally a VM guy but I'm trying to do some work on z/OS 2.2, and I
could use some help.
I'm trying to use Windows FTP to transfer a downloaded tersed file from
Windows to z/OS 2.2.
Previously, with Windows 7, I invoked FTP with this command: ftp < ftpscript.txt
The ftpscript file normally has quite a few more statements but to verify
-------------------------------
verbose
open nnn.nnn.nnn.nnn
myuser
binary
put file.trs 'MYUSER.FILE.TRS'
quit
-------------------------------
The verbose statement allowed FTP to prompt for a password, in order to
avoid having the password in the text file.
Recently, I grudgingly had to upgrade to Windows 10. This process no
longer works. In trying to diagnose the problem, I used the FTP -d option
and discovered a difference between FTP on Windows 10 and FTP on Windows 7.
The Windows 10 FTP client connects to the z/OS FTP server and immediately
issues the command: OPTS UTF8 ON
501 command OPTS aborted -- no options supported for UTF8
It accepts the userid but then processes the binary statement as the
password, and of course that fails.
In the manual "z/OS Communications Server: IP Configuration Reference" I
found the EXTENSIONS statement to enable FTP to support FTP extensions. The
description of EXTENSIONS UTF8 states: "Enables the FTP server to respond
to the LANG command, and to use UTF–8 encoding of pathnames on the control
connection." So I added EXTENSIONS UTF8 in the TCPIP.FTP.DATA dataset. I
cycled the FTP daemon started task, and the TCPIP started task, and even
reIPLed the z/OS system. This has not made any difference.
I'm hoping to find the way for z/OS to accept the OPTS UTF8 ON command.
(Or for Windows 10 FTP to not issue the command.)
Can someone please give me some guidance on this? I'm at a loss. I've done
lots of internet searches and haven't been able to find any solution.
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Andrew Rowley
2018-06-02 00:18:11 UTC
Permalink
Raw Message
Post by Kevin Merkley
I'm normally a VM guy but I'm trying to do some work on z/OS 2.2, and I could use some help.
I'm trying to use Windows FTP to transfer a downloaded tersed file from Windows to z/OS 2.2.
One option to consider is the Windows Subsystem for Linux which gives
you the option of using a Linux FTP client.
https://docs.microsoft.com/en-us/windows/wsl/install-win10

My experience has been that the Linux client is more flexible and there
is also more documentation available.
--
Andrew Rowley
Black Hill Software
+61 413 302 386

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Paul Gilmartin
2018-06-02 01:27:44 UTC
Permalink
Raw Message
Hi, Kevin,
Post by Mike Hochee
Note: In Windows 8 and Windows Server 2012 or later operating systems, the text file must be written in UTF-8.
That's weird. And irritating. Does "text file" refer to the command file or
to the data file? In either case, it shouldn't matter: USASCII is a subset of
UTF-8, and there's no reason the commands should contain non-ASCII
characters. (Or does Windows inflict a BOM on you?)

Is sftp an option? Perhaps the PSFTP component of PuTTY?

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Seymour J Metz
2018-06-04 17:23:15 UTC
Permalink
Raw Message
Some windoze programs inflict a BOM on you; that breaks existing software. In some cases it is not obvious from the error message that there is a garbage character at the beginning of the file; you have to use an editor that does not swallow U+FEFF .


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List <IBM-***@listserv.ua.edu> on behalf of Paul Gilmartin <0000000433f07816-dmarc-***@listserv.ua.edu>
Sent: Friday, June 1, 2018 9:27 PM
To: IBM-***@listserv.ua.edu
Subject: Re: problem with FTP from Windows 10 to z/OS

Hi, Kevin,
Post by Mike Hochee
Note: In Windows 8 and Windows Server 2012 or later operating systems, the text file must be written in UTF-8.
That's weird. And irritating. Does "text file" refer to the command file or
to the data file? In either case, it shouldn't matter: USASCII is a subset of
UTF-8, and there's no reason the commands should contain non-ASCII
characters. (Or does Windows inflict a BOM on you?)

Is sftp an option? Perhaps the PSFTP component of PuTTY?

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Kevin Merkley
2018-06-04 14:47:43 UTC
Permalink
Raw Message
Thanks for the responses.
I did receive an explanation that OPTS UTF8 ON is not the problem. The Windows 10 FTP client uses a different function to read the password and always reads it from stdin.
This is something we send out to customers so we have to expect they may not have anything available except their Windows FTP client to upload from Windows to z/OS.
We will have to take a different approach.
Thanks again!

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Farley, Peter x23353
2018-06-04 15:12:28 UTC
Permalink
Raw Message
PMFJI here, but that is simply not true of Win 10 FTP in my experience. My company machine is Windows 10 Pro and the FTP command and script files that I use look like this (anonymized):

CMD file:

ftp -s:c:\ut\ftpscript.ftp xxx.xxx.xxx.xxx

ftpscript.ftp:

tsouser
password
quote site notrail ispfs
quote site sbdataconn=(ibm-1047,iso8859-1)

Works every time.

Peter

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of Kevin Merkley
Sent: Monday, June 4, 2018 10:48 AM
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: problem with FTP from Windows 10 to z/OS

EXTERNAL EMAIL

Thanks for the responses.
I did receive an explanation that OPTS UTF8 ON is not the problem. The Windows 10 FTP client uses a different function to read the password and always reads it from stdin.
This is something we send out to customers so we have to expect they may not have anything available except their Windows FTP client to upload from Windows to z/OS.
We will have to take a different approach.
Thanks again!

--


This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system.


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Farley, Peter x23353
2018-06-04 16:22:03 UTC
Permalink
Raw Message
Sorry for wasting bandwidth, I missed the part where you wanted the "password not in the script" option. I didn't realize the Win 7 FTP did that and that Win 10 does not since I always just used "password in the script" for my personal use.

Peter

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of Farley, Peter x23353
Sent: Monday, June 4, 2018 11:12 AM
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: problem with FTP from Windows 10 to z/OS

PMFJI here, but that is simply not true of Win 10 FTP in my experience. My company machine is Windows 10 Pro and the FTP command and script files that I use look like this (anonymized):

CMD file:

ftp -s:c:\ut\ftpscript.ftp xxx.xxx.xxx.xxx

ftpscript.ftp:

tsouser
password
quote site notrail ispfs
quote site sbdataconn=(ibm-1047,iso8859-1)

Works every time.

Peter

-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-***@LISTSERV.UA.EDU] On Behalf Of Kevin Merkley
Sent: Monday, June 4, 2018 10:48 AM
To: IBM-***@LISTSERV.UA.EDU
Subject: Re: problem with FTP from Windows 10 to z/OS

EXTERNAL EMAIL

Thanks for the responses.
I did receive an explanation that OPTS UTF8 ON is not the problem. The Windows 10 FTP client uses a different function to read the password and always reads it from stdin.
This is something we send out to customers so we have to expect they may not have anything available except their Windows FTP client to upload from Windows to z/OS.
We will have to take a different approach.
Thanks again!

--

This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system.


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Donald J
2018-06-06 11:50:34 UTC
Permalink
Raw Message
You could write a VBscript that creates your FTP script.
Store the password in a Win10 user or volatile environment variable.
The VBscript could run the FTP script, then delete the script file,
so there is no password kept on disk for more than the duration of
the ftp.

I would also recommmend using FTPS with Curl.

Set the password:
set objShell = CreateObject( "WScript.Shell" )
Set objSystemEnv = objShell.Environment( "VOLATILE" )
objSystemEnv( "ZZPASS" )=V_PW

Retrieve the password:
set objShell = CreateObject( "WScript.Shell" )
Set objSystemEnv = objShell.Environment( "VOLATILE" )
V_PW = objSystemEnv( "ZZPASS" )
Sent: Monday, June 04, 2018 at 9:47 AM
Subject: Re: problem with FTP from Windows 10 to z/OS
Thanks for the responses.
I did receive an explanation that OPTS UTF8 ON is not the problem. The Windows 10 FTP client uses a different function to read the password and always reads it from stdin.
This is something we send out to customers so we have to expect they may not have anything available except their Windows FTP client to upload from Windows to z/OS.
We will have to take a different approach.
Thanks again!
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Paul Gilmartin
2018-06-04 17:09:40 UTC
Permalink
Raw Message
Post by Farley, Peter x23353
Sorry for wasting bandwidth, I missed the part where you wanted the "password not in the script" option. I didn't realize the Win 7 FTP did that and that Win 10 does not since I always just used "password in the script" for my personal use.
Does Windows provide anything similar to Command Substitution that could
be used to prompt for a password?

(I understand that Win 10 now supports bash, so this isn't entirely implausible.)

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Paul Gilmartin
2018-06-06 13:00:13 UTC
Permalink
Raw Message
Post by Donald J
You could write a VBscript that creates your FTP script.
Store the password in a Win10 user or volatile environment variable.
The VBscript could run the FTP script, then delete the script file,
so there is no password kept on disk for more than the duration of
the ftp.
Why not pipe the script output to the FTP command and never have the
password on disk?

I suggested bash, which is available on a greater variety of desktop
systems than VBscript.
Post by Donald J
I would also recommmend using FTPS with Curl.
I suggested something similar, but the OP is in an ISV position and can't count
on customers' having optional products.
Post by Donald J
set objShell = CreateObject( "WScript.Shell" )
Set objSystemEnv = objShell.Environment( "VOLATILE" )
objSystemEnv( "ZZPASS" )=V_PW
How does the V_PW (variable?) get set?
Post by Donald J
set objShell = CreateObject( "WScript.Shell" )
Set objSystemEnv = objShell.Environment( "VOLATILE" )
V_PW = objSystemEnv( "ZZPASS" )
Sent: Monday, June 04, 2018 at 9:47 AM
From: "Kevin Merkley"
This is something we send out to customers so we have to expect they may not have anything available except their Windows FTP client to upload from Windows to z/OS.
-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Donald J
2018-06-06 13:22:09 UTC
Permalink
Raw Message
Post by Paul Gilmartin
How does the V_PW (variable?) get set?
I have another VBscript that reads the password using
a masked input window. I use it for ServiceNow queries.
A cookie is then created for ServiceNow which I can use
after that.
Post by Paul Gilmartin
Sent: Wednesday, June 06, 2018 at 8:00 AM
Subject: Re: problem with FTP from Windows 10 to z/OS
Post by Donald J
You could write a VBscript that creates your FTP script.
Store the password in a Win10 user or volatile environment variable.
The VBscript could run the FTP script, then delete the script file,
so there is no password kept on disk for more than the duration of
the ftp.
Why not pipe the script output to the FTP command and never have the
password on disk?
I suggested bash, which is available on a greater variety of desktop
systems than VBscript.
Post by Donald J
I would also recommmend using FTPS with Curl.
I suggested something similar, but the OP is in an ISV position and can't count
on customers' having optional products.
Post by Donald J
set objShell = CreateObject( "WScript.Shell" )
Set objSystemEnv = objShell.Environment( "VOLATILE" )
objSystemEnv( "ZZPASS" )=V_PW
How does the V_PW (variable?) get set?
Post by Donald J
set objShell = CreateObject( "WScript.Shell" )
Set objSystemEnv = objShell.Environment( "VOLATILE" )
V_PW = objSystemEnv( "ZZPASS" )
Sent: Monday, June 04, 2018 at 9:47 AM
From: "Kevin Merkley"
This is something we send out to customers so we have to expect they may not have anything available except their Windows FTP client to upload from Windows to z/OS.
-- gil
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to ***@listserv.ua.edu with the message: INFO IBM-MAIN
Loading...