Cannot parse LIST line for z/OS member with no statstics
WinSCP version: 5.19.6
Windows version: Windows 10 Enterprise 20H2
Transfer protocol: FTP
I am attempting use WinSCP to connect to a z/OS Communications Server 2.3 FTP server, to the "MVS" side of the system (as opposed to the Open Edition MVS aka Unix side).
One problem I'm having is with files that are members of a Partitioned Data Set (aka Library) in MVS. The FTP server responds to the LIST command by listing each member name along with its statistics. FTP clients interpret this as if each member is a unique file. WinSCP works in that case.
But, statistics are OPTIONAL in MVS. They are often created by default, such as if the member is a source (text) file that was edited by the standard text editor. But there are a zillion ways to have members that do not have any associated statistics.
For example, if I have these members in a z/OS library:
Notice that the LOADLIST member has no statistics. This is a valid situation.
The LIST command returns this as:
again, the LOADLIST member has no statistics.
But, WinSCP can't parse that line. It either interprets it as some kind of directory or doesn't return it at all:
The result is that you can not use WinSCP to GET such a file.
I recreated this in the attached log, as follows:
1. I am using the command line, because I haven't been able to get WinSCP GUI to work with z/OS at all. This may be do to problems in directory caching.
2. I used RegEdit to manually delete the
I manually deleted the key because I couldn't figure out how to do it from the command line. For example, invoking with
3. I invoked WinSCP as:
I am using the host with the protocol because otherwise it tries to make a secure connection, which will not work on this host. I couldn't figure out any other way to get the command line to just connect with FTP.
4. I changed to the desired directory, and then did...
5.
the result was as shown above.
6. I did
One question would be, what should WinSCP set the file stats to if you were able to download a member without server side statistics? Windows command-line FTP just sets the created & modified dates to the current date & time.
Windows version: Windows 10 Enterprise 20H2
Transfer protocol: FTP
I am attempting use WinSCP to connect to a z/OS Communications Server 2.3 FTP server, to the "MVS" side of the system (as opposed to the Open Edition MVS aka Unix side).
One problem I'm having is with files that are members of a Partitioned Data Set (aka Library) in MVS. The FTP server responds to the LIST command by listing each member name along with its statistics. FTP clients interpret this as if each member is a unique file. WinSCP works in that case.
But, statistics are OPTIONAL in MVS. They are often created by default, such as if the member is a source (text) file that was edited by the standard text editor. But there are a zillion ways to have members that do not have any associated statistics.
For example, if I have these members in a z/OS library:
Name Prompt Size Created Changed ID LOADLIST MAGPCM0A 1570 2001/01/30 2022/02/07 02:28:02 TTPJMD1 MAGPCM1A 2663 2000/08/18 2022/02/07 02:28:53 TTPJMD1 MAGPCM2A 2494 2000/11/30 2022/03/03 12:27:47 TTPJMD1 MAGYCM13 26 1988/11/01 2022/02/07 02:25:11 TTPJMD1
The LIST command returns this as:
LOADLIST MAGPCM0A 01.00 2001/01/30 2022/02/07 02:28 1570 1520 0 TTPJMD1 MAGPCM1A 01.00 2000/08/18 2022/02/07 02:28 2663 2549 0 TTPJMD1 MAGPCM2A 01.01 2000/11/30 2022/03/03 12:27 2494 1823 0 TTPJMD1 MAGYCM13 01.00 1988/11/01 2022/02/07 02:25 26 17 0 TTPJMD1
But, WinSCP can't parse that line. It either interprets it as some kind of directory or doesn't return it at all:
D--------- 0 0 .. ---------- 0 1570 Feb 7 2:28 MAGPCM0A ---------- 0 2663 Feb 7 2:28 MAGPCM1A ---------- 0 2494 Mar 3 12:27 MAGPCM2A ---------- 0 26 Feb 7 2:25 MAGYCM13
The result is that you can not use WinSCP to GET such a file.
I recreated this in the attached log, as follows:
1. I am using the command line, because I haven't been able to get WinSCP GUI to work with z/OS at all. This may be do to problems in directory caching.
2. I used RegEdit to manually delete the
Computer\HKEY_CURRENT_USER\SOFTWARE\Martin Prikryl\WinSCP 2\Configuration\History
key. This is because until I realized that the directory cache was at fault, I was having about a 1% success rate with directory traversal in WinSCP on z/OS. It was bizarre: I might be able to get it to work one time, but then the identical set of commands would no longer work, and it would get to the point where it wouldn't permit me to perform ANY CD command, even after quitting the session and restarting.
I manually deleted the key because I couldn't figure out how to do it from the command line. For example, invoking with
/command refresh
gave a an error "Unknown command 'refresh'.".
3. I invoked WinSCP as:
winscp.com ftp://plp312.sys.eds.com /log=winscp.log
.
I am using the host with the protocol because otherwise it tries to make a secure connection, which will not work on this host. I couldn't figure out any other way to get the command line to just connect with FTP.
4. I changed to the desired directory, and then did...
5.
LS
the result was as shown above.
6. I did
MGET *
, to show that it only downloads the files that have statistics. It downloaded the 4 members with statistics, but not member LOADLIST.
One question would be, what should WinSCP set the file stats to if you were able to download a member without server side statistics? Windows command-line FTP just sets the created & modified dates to the current date & time.