z/OS Communications Server: IP User's Guide and Commands
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Examples of Get, MGet and MVSGet subcommands

z/OS Communications Server: IP User's Guide and Commands
SC27-3662-00

Results:
  1. If the LISTSUBdir option is not specified on the SITE subcommand and the LISTSUBDIR statement is not specified in the server FTP.DATA file, the default is as if the LISTSUBdir option was specified on the SITE subcommand.
  2. If the z/OS® FTP server has the NOLISTSUBDIR option on the SITE subcommand or LISTSUBDIR FALSE in the server FTP.DATA file, then an mget * command gets only the files in the current directory.
Restrictions:
  1. The LISTSUBDIR statement applies to z/OS UNIX file operations only. MVS™ data set operations are not affected.
  2. The SITE LISTSUBDIR command is supported by z/OS FTP in V1R7 and later releases. The FTP client must be communicating with a z/OS V1R7 or later FTP server or an unrecognized parameter response results.

Example 1: GET and MGET enable you to obtain files from a remote host and send them to the local host. In this example, FTP subcommands are issued from MVSXA2 to MVSVIC03. See Table 1 for other subcommands useful for working with and transferring data.

The following members exist in the data set USER121.FTP.EXAMPLE on MVSVIC03:
  • FILE1
  • FILE2
  • FILE3
  • FILE4
  • FILE5
The following is displayed when entering the FTP environment:
  User:  ftp 9.67.113.24 621
System:
           IBM FTP CS V1R5
           FTP: using TCPCS
           Connecting to 9.67.113.24, port 621
           220-FTPD1 IBM FTP CS V1R2 at MVS164, 20:12:38 on 2003-01-02.
           220 Connection will not timeout.
           NAME (<host>:tsouserid):
  User:  user121
System:
           >>>USER user121
           331 Send password please.
           Password:
           >>>PASS ********
           230 USER121 is logged on.  Working directory is "/u/user121".
           Command:
  User:  get 'user121.ftp.example(file1)' 'user121.ftp.example(file1)'
System:
           'USER121.FTP.EXAMPLE(FILE1)' IS AN non-EXISTENT PARTITIONED DATASET.
           USE LMKDIR TO CREATE IT. LOCAL FILE NOT FOUND
           COMMAND:
  User:  lmkdir 'user121.ftp.example'
System:
           USER121.FTP.EXAMPLE CREATED.
           COMMAND:
  User:  get 'user121.ftp.example(file1)' 'user121.ftp.example(file1)'
System:
           >>>PORT 9,67,112,25,4,9
           200 Port request OK.
           >>>RETR 'USER121.ftp.example(file1)'
           125 Sending data set USER121.FTP.EXAMPLE(FILE1) FIXrecfm 128
           250 Transfer completed successfully.
           3464 bytes transferred in 0.754 seconds. Transfer rate 4.59 Kbytes/sec.
           Command:
  User:  get 'user121.ftp.example(file2)' 'user121.ftp.example(file2)'
  System:
           >>>PORT 9,67,112,25,4,34
           200 Port request OK.
           >>>RETR 'USER121.ftp.example(file2)'
           125 Sending data set USER121.FTP.EXAMPLE(FILE2) FIXrecfm 128
           250 Transfer completed successfully.
           3464 bytes transferred in 1.483 seconds. Transfer rate 2.34 Kbytes/sec.
           Command:
 
  User:  get 'user121.ftp.example(file2)' 'user121.ftp.example(file2)'
System:
           Data set 'USER121.FTP.EXAMPLE(FILE2)' was not replaced.
           Local file already exists
           To replace it, use command with the (REPLACE option
           Command:
  User:  get 'user121.ftp.example(file2)' 'user121.ftp.example(file2)' (replace
System:
           >>>PORT 9,67,112,25,4,35
           200 Port request OK.
           >>>RETR 'user121.ftp.example(file2)'
           125 Sending data set USER121.FTP.EXAMPLE(FILE2)
           250 Transfer completed successfully.
           3464 bytes transferred in 0.767 seconds. Transfer rate 0.50 Kbytes/sec.
           Command:
  User:  lpwd
System:
           Local directory is USER121
           COMMAND:
  User:  mget 'user121.ftp.example(file3)' 'user121.ftp.example(file4)'
System:
           >>>PORT 9,67,112,25,4,10
           200 Port request OK.
           >>>NLST 'user121.ftp.example(file3)'
           125 List started OK.
           250 List completed successfully.
           >>>PORT 9,67,112,25,4,11
           200 Port request OK.
           >>>NLST 'user121.ftp.example(file4)'
           125 List started OK.
           250 List completed successfully.
           >>>PORT 9,67,112,25,4,12
           200 Port request OK.
           >>>RETR 'USER121.FTP.EXAMPLE(FILE3)'
           125 Sending data set USER121.FTP.EXAMPLE(FILE3)
           250 Transfer completed successfully.
           3993 bytes transferred in 0.745 seconds. Transfer rate 0.51 Kbytes/sec.
           >>>PORT 9,67,112,25,4,13
           200 Port request OK.
           >>>RETR 'USER121.FTP.EXAMPLE(FILE4)'
           125 Sending data set USER121.FTP.EXAMPLE(FILE4)
           250 Transfer completed successfully.
           7367 bytes transferred in 0.818 seconds. Transfer rate 9.01 Kbytes/sec.
           Command:
  User:  lpwd
System:
           Local directory is USER121.
           Command:
  User:  cd 'user121.ftp.example'
System:
           >>>CWD 'user121.ftp.example'
           250 "USER121.FTP.EXAMPLE" partitioned data set is working directory.
           Command:
  User:  pwd
System:
           >>>PWD
           257 "USER121.FTP.EXAMPLE" partitioned data set is working directory.
           Command:
  User:  mget file3 file4
System:
           >>>PORT 9,67,112,25,4,20
           200 Port request OK.
           >>>NLST file3
           125 List started OK.
           250 List completed successfully.
           >>>PORT 9,67,112,25,4,21
           200 Port request OK.
           >>>NLST file4
           125 List started OK.
           250 List completed successfully.
           >>>PORT 9,67,112,25,4,22
           200 Port request OK.
           >>>RETR FILE3
           125 Sending data set USER121.FTP.EXAMPLE(FILE3)
           250 Transfer completed successfully.
           3993 bytes transferred in 0.549 seconds. Transfer rate 0.46 Kbytes/sec.
           >>>PORT 9,67,112,25,4,23
           200 Port request OK.
           >>>RETR FILE4
           125 Sending data set USER121.FTP.EXAMPLE(FILE4)
           250 Transfer completed successfully.
           7367 bytes transferred in 0.936 seconds. Transfer rate 0.23 Kbytes/sec.
           Command:
  User:  quit
System:
           >>>QUIT
           221 Quit command received.  Goodbye.
           READY
  User:  ftp 9.67.113.24 621
System:
           IBM FTP CS V1R5   2003  314 01:11 UTC
           Connecting to 9.67.113.24, port 621
           220-FTPD1 IBM FTP CS/390 V2R10 AT MVS164, 20:12:38 ON 2003-01-02.
           220 Connection will not timeout.
           NAME (<host>:tsouserid):
  User:  user121
System:
           >>>USER user121
           331 Send password please.
           Password:
           >>>PASS ********
           230 USER121 is logged on.  Working directory is "/u/user121".
           Command:
  User:  get '/u/user121/ftp.example/file1' 'user121.ftp.example(file1)'
System:
           >>>PORT 9,67,112,25,4,24
           200 Port request OK.
           >>>RETR '/u/user121/ftp.example/file1'
           125 Sending data set /u/user121/ftp.example/file1
           250 Transfer completed successfully.
           3464 bytes transferred in 1.391 seconds. Transfer rate 2.49 Kbytes/sec.
           Command:
  User:  lcd 'user121.ftp.example'
System:    Local directory name set to partitioned data set USER121.FTP.EXAMPLE.
           Command:
  User:  lpwd
System:    Local directory is partitioned data set USER121.FTP.EXAMPLE.
           Command:
  User:  cd '/u/user121/ftp.example'
System:    >>>CWD '/u/user121.ftp.example'
           250 HFS directory /u/user121/ftp.example is the current working
               directory
           Command:
  User:  pwd
System:    >>>PWD
           257 "/u/user121.ftp.example" is the HFS working directory.
           Command:
  User:  get file1
System:    >>>PORT 9,67,112,25,4,26
           200 Port request OK.
           >>>RETR file1
           125 Sending data set /u/user121/ftp.example/file1
           250 Transfer completed successfully.
           3464 bytes transferred in 1.059 seconds. Transfer rate 3.27 kbytes/sec.
           Command:
  User:  mget '/u/user121/ftp.example/file4' '/u/user121/ftp.example/file5'
System:
            >>>PORT 9,67,112,25,4,33
            200 Port request OK.
            >>>NLST '/u/user121/ftp.example/file4'
            125 List started OK
            250 List completed successfully.
            >>>PORT 9,67,112,25,4,34
            200 Port request OK.
            >>>NLST '/u/user121/ftp.example/file5'
            125 List started OK
            250 List completed successfully.
            >>>PORT 9,67,112,25,4,35
            200 Port request OK.
            >>>RETR /u/user121/ftp.example/file4
            125 Sending data set /u/user121/ftp.example/file4
            250 Transfer completed successfully.
            7367 bytes transferred in 1.324 seconds. Transfer rate 5.56
               kbytes/sec.
            200 Port request OK.
            >>>RETR /u/user121/ftp.example/file5
            125 Sending data set /u/user121/ftp.example/file5
            250 Transfer completed successfully.
            3464 bytes transferred in 0.951 seconds. Transfer rate 3.64
               kbytes/sec.
            Command:
The data set USER121.FTP.EXAMPLE on MVSXA2 now contains the following members:
  • FILE1
  • FILE2
  • FILE3
  • FILE4
  • FILE5
Restrictions:
  1. You do not have a choice of names for the local file as a result of the MGET subcommand.
  2. The MGET subcommand is not applicable for generation data groups (GDGs).

Example 2: MGET with SITE LISTSUBDIR

Following is an example of mget * with SITE LISTSUBDIR. This setting affects processing of the NLST command. The z/OS FTP client sends an NLST command to the server as part of mget * subcommand processing. LISTSUBDIR specifies that both the current and next subdirectory should be retrieved from the server as a result of processing an mget * subcommand. In this example, the current directory has a file x and a subdirectory y and subdirectory y has a file x.
site listsubdir
>>> SITE listsubdir
200 SITE command was accepted
mget * (rep
>>> PORT 127,0,0,1,4,13
200 Port request OK.
>>> NLST *
125 List started OK
250 List completed successfully.
>>> PORT 127,0,0,1,4,14
200 Port request OK.
>>> RETR x
125 Sending data set /tmp/mgetmput/x
250 Transfer completed successfully.
>>> PORT 127,0,0,1,4,14
200 Port request OK.
>>> RETR y/x
125 Sending data set /tmp/mgetmput/y/x
250 Transfer completed successfully.
5 bytes transferred in 1.010 seconds.  Transfer rate 0.00 Kbytes/sec.
Command:

Example 3: MGET with SITE NOLISTSUBDIR

Following is an example of mget * with SITE NOLISTSUBDIR. This setting affects processing of the NLST command. The z/OS FTP client sends an NLST command to the server as part of mget * subcommand processing. NOLISTSUBDIR specifies that only the current directory should be retrieved from the server as a result of processing an mget * subcommand. In this example, the current directory has a file x and a subdirectory y and subdirectory y has a file x.
site nolistsubdir
>>> SITE nolistsubdir
200 SITE command was accepted
mget * (rep
>>> PORT 127,0,0,1,4,13
200 Port request OK.
>>> NLST *
125 List started OK
250 List completed successfully.
>>> PORT 127,0,0,1,4,14
200 Port request OK.
>>> RETR x
125 Sending data set /tmp/mgetmput/x
250 Transfer completed successfully.
5 bytes transferred in 1.010 seconds.  Transfer rate 0.00 Kbytes/sec.
Command:

Example 4: MVSGET with a physical sequential data set transferred

Following is a sample entry and response that is displayed after the MVSGET subcommand is used to transfer a physical sequential data set:

mvsget 'user1.ps.source' 'user1.ps.target' (REAllocate  
EZA1701I >>> XDSS 'user1.ps.source' 
200-LASTREF=2011/12/06 DSEMPTY=FALSE
200 SITE DSNTYPE=BASIC RECFM=VB BLKSIZE=6233 LRECL=256 PRIMARY=16   SECONDARY=1 TRACKS EA
TTR=SYSTEM  EZZ9815I local site variables have changed  
EZA1701I >>> PORT 127,0,0,1,4,5  
200 Port request OK. 
EZA1701I >>> RETR 'user1.ps.source' 
125 Sending data set USER1.PS.SOURCE  
250 Transfer completed successfully. 
EZA2108I Confidence=High for MVSGET of USER1.PS.TARGET 
EZA1617I 286 bytes transferred in 0.020 seconds.  Transfer rate 14.30 Kbytes/sec
Restrictions: For more restrictions about the MVSGet subcommand, see MVSGet subcommand – Copy a remote data set into a local data set with the remote data set attributes

Example 5: MVSGet with a PDS data set transferred

Following is a sample entry and response that is displayed after the MVSGet subcommand is used to transfer a PDS data set:

mvsget 'user1.remote.pds' 'user1.local.pds' (REAllocate
 EZA1701I >>> XDSS 'user1.remote.pds'
200-LASTREF=2011/12/16 DSEMPTY=FALSE 
200 SITE PDSTYPE=PDS RECFM=VB BLKSIZE=6233 DIRECTORY=27 LRECL=256 PRIMARY=1 SECO
NDARY=1 TRACKS EATTR=SYSTEM 
EZZ9815I local site variables have changed  
EZA2245I "USER1.LOCAL.PDS" created. 
EZA2081I Local directory name set to partitioned data set USER1.LOCAL.PDS       
EZA1701I >>> PWD 
257 "'USER1.'" is working directory.  
EZA1701I >>> CWD 'user1.remote.pds' 
250 The working directory "USER1.REMOTE.PDS" is a partitioned data set          
EZA1701I >>> PORT 127,0,0,1,4,5   
200 Port request OK.   
EZA1701I >>> NLST *  
125 List started OK. 
250 List completed successfully.  
EZA1701I >>> PORT 127,0,0,1,4,6  
200 Port request OK. 
EZA1701I >>> RETR NEW1  
125 Sending data set USER1.REMOTE.PDS(NEW1) 
250 Transfer completed successfully. 
EZA1617I 134 bytes transferred in 0.010 seconds.  Transfer rate 13.40 Kbytes/sec.  
EZA1701I >>> PORT 127,0,0,1,4,7 
200 Port request OK. 
EZA1701I >>> RETR NEW2 
125 Sending data set USER1.REMOTE.PDS(NEW2)
250 Transfer completed successfully.
EZA1617I 134 bytes transferred in 0.010 seconds.  
Transfer rate 13.40 Kbytes/sec.  
EZA2581I Local HFS directory is /u/user1 . 
EZA1701I >>> CWD 'USER1.' 
250 "USER1." is working directory name prefix
EZA2108I Confidence=High for MVSGET of USER1.LOCAL.PDS 
Restrictions: For more restrictions about the MVSGet subcommand, see MVSGet subcommand – Copy a remote data set into a local data set with the remote data set attributes

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2013
This information center is Built on Eclipse™ ( www.eclipse.org ).