| FTPing VSAM Data Sets using Shell Views: We basically convert the shell view into a specific view, then perform the FTP as per following: 1) Move into the view subdirectory (i.e., issue CD /VSHELL), then 2) Point the shell view, VSEHLL, to a real vsam data set, then 3) Fix all missing, or incorrect, data set attributes, then 4) Perform your FTP. Procedure Details: 1) Move into the subdirectory (in our case, VSHELL): Line-mode clients: issue CD /VSHELL Graphical clients: click on the view subdirectory, VSEHLL, icon. Graphical clients automatically issue a DIR as soon as you click on a subdirectory icon. If you are using a line-mode client, and care to issue a DIR, then here is what you get back from the server: Oops! Nothing (i.e., null listing). Well, this actually makes sense because our view, VSHELL, does not point to a real VSAM data set, yet. So, without any further ado, let's fix this problem (i.e., let's point to a real VSAM data set). 2) Point the view to a real VSAM data set: In order to do this, you, the user, must know the real data set name! Line-mode clients: issue CD real_vsam_data_set_name Graphical clients: modify the path to point to the real_vsam_data_set Graphical clients, again, automatically issue a DIR as soon as you modify the path. If you are using a line-mode client, and care to issue a DIR, then here is what you get back from the server: Our subdirectory is no longer empty!! It contains exactly one data file entry! What does it mean and where does it come from? Well, this data file entry logically represents the real data set the view, VSHELL, now points to. Please note that the server neither uses, nor cares about, this logical data file entry. Therefore, the user may also safely ignore it on his GETs and PUTs as well. The Admin can control the name you see by coding CTL_FTPC_NAME in the view. If this statement is not coded, the server, as a default, uses the view's name. For more information about CTL_FTPC_NAME statement, please see 3) Fix all missing, or incorrect, data set attributes: We must fix all required data set attributes: a. TYPE (ESDS, KSDS, RRDS or VRDS), b. Record Format (Fixed, Variable or Spanned), c. Record Length, d. Data set Disposition. e. Catalog's DLBL (not the catalog's name!) To do so, Issue the required SITE commands using your client's method of issuing SITE or Custome commands. And as a precaution, we start off by issuing SITE PARM = OFF . It turns off all pending values that might be incorrect from previous SITE commands. 4) Perform your FTP: We are now ready to do downloads (i.e., issue GETs) and uploads (i.e., issue PUTs) as follows: GET file_name where file_name is the actual file you want to download to (on the client side), and PUT file_name where file_name is the actual file you want to upload from (on the client side).. For more information, please |
| ftp> dir 200 Command okay. 150 File status okay, about to open data connection. 226 Closing data connection. |
| How to FTP VSAM Data Sets Using VSAM Shell Views: |
| Sample View: The following VSAM view will be used to demonstrate how to access VSAM data sets using a shell view. Assume that the administrator already coded the following shell view and saved it under the name of VSHELL.FTPC: |
| Introduction: This page explains how to FTP VSAM data sets using Shell views. We basically transform the shell view into a specific-like view, then perform the FTP. |
| XFER = begin TYPE = RCV TGT_AM = VSAM XFER = end |
| tp> ftp> cd /VSHELL 250 Requested file action okay, completed. |
| ftp> cd listing.esds point to real data set name. 250 Requested file action okay, completed. ftp> |
| 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 VSHELL Ha! a file, not subdirectory, entry!!!! 226 Closing data connection. ftp: 56 bytes received in 0.38Seconds 0.15Kbytes/sec. ftp> |
| ftp> ftp> literal site parm = off turn off all values that might be penfing. 200 Command okay. ftp> ftp> ftp> literal stite type = esds Watch your fingers on that keyboard!!! 500 Syntax error, command unrecognized. ftp> ftp> ftp> literal site type = actual_VSAM_data_set_type (for example: listing.esds) 200 Command okay. ftp> literal site disp = data_set_disposition (for example: new) 200 Command okay. ftp> literal site recl = logical_record_length (for example: 300) 200 Command okay. ftp> literal site recf = logical_record_format (for example: fixed 200 Command okay. ftp> literal site catalog = dlbl_for_catalog_pointing_to_data_set (for example: VSESP). 200 Command okay. . |
| Download & Upload examples: Example 1: Download data from a VSAM data set: The following snapshot logically converts the SHELL view into to a specific view pointing to an ESDS file whose real name is listing.esds. It shows, in detail, how to: 1) Move into the subdirectory (i.e., issue CD /VSHELL), then 2) Point the view to the real VSAM data set listing.esds (i.e., issue CD listing.esds), then 3) Fix all missing, or incorrect, data set attributes (i.e., issue SITE commands), then 4) Download data into stuff.txt (i.e., issue GET stuff.txt). Example 2: Upload data to a VSAM data set: The following snapshot logically converts the SHELL view to a specific view pointing to a VRDS file whose real name is test.vrds. It shows how to: 1) Move into the subdirectory (i.e., issue CD /VSHELL), then 2) Point the view to the real VSAM data set test.vrds (i.e., issue CD test.vrds), then 3) Fix all missing, or incorrect, data set attributes (i.e., issue SITE commands), then 4) Upload data from test.txt (i.e., issue PUT test.txt). |
| ftp> ftp> cd /vshell 1) CD into VSHELL 250 Requested file action okay, completed. ftp> cd test.vrds 2) Point to real data set name. 250 Requested file action okay, completed. ftp> ftp> ftp> literal site parm = off 3) Fix data set attributes. 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> literal site catalog = vsesp 200 Command okay. ftp> ftp> ftp> put test.txt 4) upload data from test.txt 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. ftp> ftp> |
| ftp> ftp> cd /vshell 1) CD into VSHELL 250 Requested file action okay, completed. ftp> cd listing.esds 2) Point to real data set name. 250 Requested file action okay, completed. ftp> ftp> literal site parm = off 3) Fix those missing data set attributes.. 200 Command okay. 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> literal site catalog = vsesp 200 Command okay. ftp> ftp> get stuff.txt 4) download data into stuff.txt 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> |