Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


I'm trying to connect to a mainframe using a command file and User id is OPPR123. When I manually log in through the GUI, I get "no dataset found", but then end up in /'OPPR123.'/. I the command file I have as follows:
option batch off
option confirm off
open "Sitefolder/Sitename"
cd "/'OPPR123.'/"
put E:\JOB2250270.txt 'JXU.UTUC.TFUUHM.TEMP' -resumesupport=off -nopreservetime -nopermissions

When runs with the above command, I end up with the following:
batch           off       

confirm         off       
Connecting to ...
Starting the session...
Session started.
Active session: [1] sitefolder/sitename
Error changing directory to '/'OPPR123.'/'.
CWD cmd failed : EDC5129I No such file or directory. (errno2=0x05190050)
Using configured transfer settings different from factory defaults.
E:\JOB2250270.txt |          348 B |    0.0 KB/s | binary | 100%
Error listing directory '/'OPPR123.''.
No data sets found.
(A)bort, (R)etry, (S)kip:

I also tried the command file:
option batch off
option confirm off
open "sitefolder/sitename"
cd "/"
put E:\JOB2250203.txt 'JXU.UTUC.TFUUHM.TEMP' -resumesupport=off -nopreservetime -nopermissions

The file was uploaded successfully, but when it was checked on the host, the text was garbled.
When I use a different FTP client that came with our file transfer automation software, I see in the logs
230 OPPR123 is logged on.  Working directory is "OPPR123.".

The reason I'm wanting to use WinSCP is I can save the sites, and then depending on the file name, I can dynamically create the command file to use with the applicable site and upload the file. So files matching JXU.UTUC.TFUUHM.TEMP will be uploaded to saved site going to the mainframe and then others to a different site.
Any ideas?

Re: Mainframe FTPS using WinSCP (GUI and Command-line)

Isn't that WinSCP supports only SSH FTP - I.e. "SFTP" - not FTPS (FTP over SSL) ?

Re: Mainframe FTPS using WinSCP (GUI and Command-line)

Thanks for sharing your findings.

Mainframe FTPS using WinSCP (GUI and Command-line)

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.