| 1) List The VSAM Catalog: To list, or display, the catalog, we: a) Move into the view subdirectory, VCATALOG, then b) List the catalog: a) Move into the view Subdirectory, VCATALOG: Line mode clients: issue CD /VCATALOG GUI clients: click on the VCATALOG subdirectory icon. b) List the Catalog: Line mode clients: Issue DIR GUI clients: normally issue DIR automatically for you. The server returns all real VSAM data sets you are authorized to see: |
ftp> dir 200 Command okay. 150 File status okay, about to open data connection. -rw-rw-rw- 1 vse none 0 Aug 12 11:17 TEST.KSDS.CLUSTER -rw-rw-rw- 1 vse none 0 Aug 12 11:17 TEST.VRDS -rw-rw-rw- 1 vse none 0 Aug 12 11:17 TEST.LISTING.ESDS -rw-rw-rw- 1 vse none 0 Aug 12 11:17 TEST.ESDS 226 Closing data connection. ftp: 487 bytes received in 0.33Seconds 1.48Kbytes/sec. ftp> |
| 3) Perform FTPs: The Catalog view, as you might have already noticed, provides Listing capabilites. The names you see are the real VSAM data set names as they exist in the Catalog the view points to. Therefore, we must specify the real data set name on our GETs and PUTs as follows: GET real_VSAM_data_set_name tgt_file PUT src_file real_VSAM_data_set_name Example 1: Download a VSAM data set (TEST.ESDS): The following snapshot illustrates how to download an ESDS file, TEST.ESDS. Notice that we first fix the data set's attributes using a series of site commands, then we issue our GET command: Example 2: Upload a VSAM data set (TEST.VRDS): The following snapshot illustrates how to upload to a VRDS data set. Again, we first fix our data set attributes then we issue a PUT command. |
| ftp> ftp> cd vcatalog move into the vcatalog subdirectory. 250 Requested file action okay, completed. ftp> ftp> ftp> literal site parm = off reset previous, and possibly incorrect, values. 200 Command oay. ftp> literal site type = esds 200 Command okay. ftp> literal site disp = shr 200 Command okay. ftp> literal site recl = 300 200 Command okay. ftp> literal site recf = fixed 200 Command okay. ftp> ftp> ftp> get test.esds test.txt GET real_VSAM_data_set_name tgt_file_name 200 Command okay. 150 File status okay, about to open data connection. 226-Records sent : 000042606 Bytes dropped: n/a 226 Closing data connection. ftp: 12867012 bytes received in 48.06Seconds 267.73Kbytes/sec. ftp> |
| ftp> ftp> literal site parm = off 200 Command okay. ftp> literal site disp = new 200 Command okay. ftp> literal site type = vrds 200 Command okay. ftp> literal site recl = 300 200 Command okay. ftp> literal site recf = variable 200 Command okay. ftp> ftp> ftp> cd /vcatalog 250 Requested file action okay, completed. ftp> ftp> ftp> put c:\stuff\vse\test.txt test.vrds 200 Command okay. 150 File status okay, about to open data connection. 226-Records rcvd : 000022929 Bytes dropped: 000000000 226 Closing data connection. ftp: 2627561 bytes sent in 91.12Seconds 28.84Kbytes/sec. |
| How to FTP VSAM Data Sets Using VSAM Catalog Views: |
| Introduction: This page explains how to FTP VSAM data sets using Catalog views. It illustrates how to: 1) List the VSAM Catalog. 2) Fix missing, or incorrect, data set attributes, then 3) Perform the FTP. |
| Sample VSAM Catalog View: The following VSAM view will be used to demonstrate how to access VSAM data sets using a VSAM catalog view. Assume that the administrator already coded the following view and saved it under the name of VCATALOG.FTPC: |
| XFER = BEGIN TYPE = RCV TGT_AM = VSAM TGT_TYPE = Index INDEX is a keyword. TGT_CATALOG = USERCAT Catalog's actual DLBL. TGT_BUCKET = VSAM.USER.CATALOG Catalog's Actual name. XFER = END |
| 2) Fix missing, or incorrect, data set attributes: We must fix all required data set attributes, except the Catalog's DLBL because it is already coded in the view!!.: a. TYPE (ESDS, KSDS, RRDS or VRDS), b. Record Format (Fixed, Variable or Spanned), c. Record Length, d. Disposition. We do so by issuing a series of SITE commands. Study the following snapshot: |
| ftp> ftp> literal site parm = off reset previous, and possibly incorrect, values. 200 Command oay. ftp> literal site type = esds 200 Command okay. ftp> literal site disp = shr 200 Command okay. ftp> literal site recl = 300 200 Command okay. ftp> literal site recf = fixed 200 Command okay. ftp> |
| ftp> cd /vcatalog 250 Requested file action okay, completed. |