We have a Linux server that needs to send a file to a z/OS mainframe using FTPS. How do we specify the MVS data set name we want to create? When we try to FTP the file, it always prepends the mainframe user ID to the data set name.
1 Answers
For FTP transfers to z/OS there are a few considerations. First, there are two types of files you can send data to: MVS files and USS files.
MVS files are the traditional types of files on z/OS and have a format of hlq.qual1.qual2.qual3.... . USS files are saved in a format that is similar to Unix file systems. FTP can send files to both types.
For USS files you would simply follow regular FTP conventions:
cd /targetDirbinchoose the transfer method of binary or textput myfile
There is a whole discussion around encoding and translation which I'll defer.
For MVS files you follow a similar sequence except that MVS requires more information about the file like its attributes:
cd "USER1.MYFILES" - this would change to a prefix which is prepended to the file being transferred. Note you can specify any prefix, not only userid. For instance, you could usecd PROD.NEWDATA` which would create a file prefixed with PROD.NEWDATA.fileNamebinchooses the transfer method
Now you can provide information about the file attributes using the Site Command
For example:
* site 'LRECL=80 RECFM=FB BLKSIZE=3120 CYLINDERS' which tells MVS how to save the file.
Then you can send the file:
put localFileName LOCALFIL
The resulting file would be stored as USER.MYFILES.LOCALFIL
- 1,587