Topic "Mainframe FTPS using WinSCP (GUI and Command-line)"

Author Message
[View user's profile]

Joined: 2016-12-08
Posts: 3
Location: BC, Canada
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.

C:\WinSCP-5.9.2-Portable\ /console /script=FTPSGet.txt /ini=nul

option batch on
option confirm off
open ftp://user:pwd@FTPSiteURL:Port -explicittls
cd /
get ASPIN35I D:\MVSWinSCPFTPSDownloads\

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.
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25946
Location: Prague, Czechia
Thanks for sharing your findings.

You can post new topics in this forum

Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License