1

I have been making a simple ftp of my JCL after sending site filetype=jes with my C# code.
However now I am required to use SFTP to send and receive files.
I found renci.SshNet but it does not have a method to send command.

Can someone please tell me how I can SFTP a JCL to mainframe using C#?
What is the best method to go about this?

Hogstrom
  • 3,581
  • 2
  • 9
  • 25

3 Answers3

0

SFTP (not to be confused with FTPS) is not supported by .NET out of the box. You have to rely on a 3rd party library. See related question here: SFTP Libraries for .NET

  • Thanks for clarifying. It seems FTPS is required here according to the notification I received and not SFTP. Is there a library and a page I can refer to for more information on how to do it? – Shrilay Thakur Jan 08 '20 at 12:56
  • As mentioned in the related question you have to find a suitable library for the usage of SSH File Transfer Protocol (SFTP). – Robin Güldenpfennig Jan 08 '20 at 13:02
0

The answer for your stated problem is that you need FTPS and not SFTP to support JES extensions for job submission and retrieval (as well as other z/OS specific capabilities).

Here is an article that goes over the details of FTPS in c#. Its the same command sequence using the SITE command as you used under FTP.

For a comparison of SFTP and FTPS here is some information.

Found this link about FTPS setup on z/OS from Share. This should get you started. It seems more practical and applied than going to knowledge center and shows the various options and capabilities. The original author, Alfred B Christensen, is an IBMer. The material is from 2011 but is still mostly applicable today.

Here is a comparison of the technologies:

enter image description here

Here is some more background.

The issue is that ...sftp understands a set of commands subcommands similar to those of ftp. according to the linked IBM manual for SFTP. The sftp server implementation provided by IBM does not have the full set of extensions provided by the FTP Server

There are other servers out there with associated clients that can provide the capability. I'm not endorsing this product but it seems to be popular from google searches I've done Tectia The default implementation of sftp server from IBM does not support the same extensions that ftp does.

If you're looking for a seamless transition and need transport security ftps is a better option but likely requires configuration on the z/OS system if its not already enabled.

The issue is not simply the client, it is the capability of the sftp implementation on z/OS as well.

Hogstrom
  • 3,581
  • 2
  • 9
  • 25
0

The native SFTP from IBM does not support all the features of FTP. You will need to use Co:Z toolkit SFTP from Dovetailed. It's free to use with paid support available.

David Crayford
  • 571
  • 1
  • 3
  • 10