Most of the examples in this section use Tectia Client. If not mentioned otherwise, also other clients can be used. The examples apply to both Unix and Windows command-line clients.
Tectia Client on Windows and Unix contain two file transfer clients.
scpg3 is a secure replacement for remote copy and provides easy secure interactive and non-interactive file transfers.
sftpg3 is a secure replacement for FTP and provides a user interface for interactive file transfers and a batch mode for unattended file transfers.
The file transfer formats are the same as described earlier.
Example 1: Copy a Unix file to an MVS partitioned data set member using the default file transfer profile.
$ scpg3 textfile.txt user1@zos:/__USER1.TEST2.PDS/MEMBER1
Example 2: Copy an MVS sequential data set to a Windows file using a Windows file transfer profile.
C:\> scpg3 user1@zos:/ftadv:P=WIN/___USER1.TEST2.PS.FILE c:\temp\my_file.txt
Example 3: Copy a partitioned data set with members to Unix a directory and files using the default file transfer profile.
$ scpg3 -r user1@zos:/_TEST2.PDS /tmp/pds/
Example 4: File transfers between Unix and z/OS using sftpg3.
$ sftpg3 user1@zos user1@zos's password: sftp> sget /_TEST2.PDS/MEMBER1 /tmp/member1 sftp> sget /FTADV:X=BIN/__TEST.PS.FILE1 sftp> sput /tmp/local_file.txt /FTADV:P=FB80/___&SYSUID..SSZ.JCL1
Connect from Unix to z/OS using sftpg3.
Fetch an MVS PDS member into a Unix file.
Fetch an MVS data set. Use a file transfer advice string to set
Put a Unix file to an MVS data set using file transfer profile
Note that, by default, a sequential data set - not a partitioned data set - is created. If you want to store your source file to a PDS, you can do it in one of the following ways:
First create the PDS using the mkdir command. After this you can put your source file to the PDS, giving a valid member name if the source file name is not suitable.
Specify the directory size (
in the file transfer advice string as follows:
sftp> sput /tmp/local_file.txt /FTADV:P=FB80,M=10/___&SYSUID..SSZ.JCL1
Example 5: Using the sftpg3 site command to define additional data set parameters.
The sftpg3 (l)site commands are recognized only by Tectia products. File transfer advice strings should be used with other clients than Tectia.
Parameters can be entered either one by one, or several parameters can be delimited by commas or spaces. Both long parameters and abbreviations can be used. The plain site command outputs the list of entered parameters.
Example 6: File transfers using Unix OpenSSH client.
$ sftp user1@zos Connecting to zos user1@zos's password: sftp> get /_TEST2.PDS/MEMBER1 /tmp/member1 sftp> get /FTADV:X=BIN/__TEST.PS.FILE1 sftp> put /tmp/local_file.txt /FTADV:P=FB80/___&SYSUID..SSZ.JCL1
Note that, by default, a sequential data set - not a partitioned data set - is created. To store your source file to a PDS, follow the instructions presented in Example 4 above.