I was going to report an issue but while writing it up, I noticed the solution, so this post it just to help the mainframe friends who are trying to use FTPS to an IBM Mainframe using WinSCP.
There seems to be an issue with WinSCP to handle mainframe dataset names that are more than 2 parts. FileZilla has the same issue. For example
UserID.Test
will display as output to the dir command but
UserID.Test.JCL
will not. But downloading these datasets is not a problem with the command-line. See example below.
Support: Is this mainframe dataset listing thing listed as future enhancement?
You need to do a change directory command up to the second last portion of your dataset and then do a get of the last part. Also, you need to use
/ini=nls
, so it doesn't cache your remote files otherwise it will give you an error
(
Can't get attributes of file ''filename''. File or folder ''filename'' does not exist.) second time you try downloading the same file.
Example:
C:\WinSCP-5.9.2-Portable\WinSCP.com /console /script=FTPSGet.txt /ini=nul
FTPSGet.txt
option batch on
option confirm off
open ftp://user:pwd@FTPSiteURL:Port -explicittls
ASCII
cd /
cd 'UserID.T.ALLTXND'
get ASPIN35I D:\MVSWinSCPFTPSDownloads\
bye
This will download
UserID.T.ALLTXND.ASPIN35I
from the mainframe.
Navigating Datasets in the GUI:
To navigate the mainframe datasets in the GUI, use the Location Profiles feature and add the mainframe dataset name in the Remote Directory without the slash in front. So, if you need to navigate to a PDS
User.Test.Jcl(*)
, then add
'UserID.Test.Jcl'
<- notice the single quotes. If it is a regular dataset, (e.g.
UserID.Test.crap.myJunk
), then you will add
'User.Test.crap'
. This same approach works if you need to download a dataset that you have access to but does not start with your userid. Without these Location Profiles, you just sit in the OMVS root and there is no way to switch to any MVS datasets.