Interactive file transfers can be used from Unix System Services shells, for example, OMVS, Telnet, or Secure Shell sessions can be used.
The scpg3 syntax is the following:
$ scpg3 user@source:source_file user@destination:destination_file
Local paths can be specified without the
user@system:
prefix.
Note | |
---|---|
In the following examples, data set names that contain single quotes and/or
parentheses are placed in regular quotation marks ( |
A file transfer profile is not defined in the file transfer command, so the filename-matched profile is used if matched. In this case, the file name does not match any of the defined profiles, so the default profile is used (text format with code set conversion).
> scpg3 user1@10.1.70.193:source_file //FILE1.PS
or
$ scpg3 user1@10.1.70.193:source_file "//'USER1.FILE2.PS'"
A file transfer profile is not defined in the file transfer command, so the
filename-matched profile is used if matched. The data set name has the
".Z
" extension, so the correct profile is selected automatically
(binary file transfer).
$ scpg3 "//'USER1.PDS.Z'" user1@10.1.70.193:/tmp/binaries/file.Z
In this case, a Windows profile is used in order to do the Windows line delimiter conversion correctly. The profile also defines code set conversion.
$ scpg3 --dst-site="P=WIN" user1@10.1.70.100:textfile "//'USER1.WINPDS(MEM1)'"
A windows profile is used for code set and line delimiter conversions, but additional parameters are required for defining the Fixed Block file format.
$ scpg3 --dst-site="P=WIN,O=FB,R=80" user1@10.1.70.100:jcl-file "//'USER1.WINPDS(JCL)'"
To ensure that both parties handle the data set as binary, set the binary
profile (P=BIN
) or binary settings (X=BIN,F=STREAM
) to
both local and remote data sets. If you are not sure whether the profiles
are enabled, use the binary settings (X=BIN,F=STREAM
).
$ scpg3 --src-site="P=BIN" --dst-site="X=BIN,F=STREAM" //LOCAL.BINARY \ user@lpar2.example.com://REMOTE.BINARY
sftpg3 has the sput and sget commands that can be used for mainframe file transfers.
An sftpg3 connection is opened and a file is transferred from Unix to z/OS with the sget command.
$ sftpg3 user1@10.1.70.193 user1@10.1.70.193's password: sftp> lsite T=ESDS sftp> sget textfile.txt //FILE1.VSAM textfile.txt | 49B | 49B/s | TOC: 00:00:01 | 100% sftp> quit
$ sftpg3 user1@10.1.70.193 user1@10.1.70.193's password: sftp> ls mainframe_files/ source_file textfile.txt sftp> cd mainframe_files /home/user1/mainframe_files sftp> ls /home/user1/mainframe_files: binary.dat jcl sftp> sget binary.dat //'USER1.BINARY.FILE' binary.dat | 4.6kB | 4.6kB/s | TOC: 00:00:01 | 100% sftp> ascii sftp> lsite O=FB R=80 sftp> sget jcl //'USER1.PDS(MEM1)' jcl | 98B | 98B/s | TOC: 00:00:01 | 100% sftp> sput //FILE1.PS /tmp/result.txt FILE1.PS | 49B | 49B/s | TOC: 00:00:01 | 100% sftp> binary sftp> sput //BINARY.FILE binary_file.dat BINARY.FILE | 4.6kB | 4.6kB/s | TOC: 00:00:01 | 100%