LISTSUBDIR (FTP client and server) statement

Use the LISTSUBDIR statement to indicate whether wildcard searches should span subdirectories or apply only to the current working directory. You can use the SIte and LOCSIte subcommands to reset this keyword.

Server
This setting applies when processing the NLST command. The z/OS® FTP client sends an NLST command to the server when issuing any of the following subcommands:
  • LS *
  • MDELETE *
  • MGET *
Client
This setting applies when the z/OS FTP client issues an MPUT * subcommand.

This statement only applies when the asterisk (*) wildcard symbol is used in the filename parameter and the GLOB subcommand is set to expand metacharacters in file names. The ls, mdelete, mget and mput subcommands search only the subdirectories of the current path. They do not search multiple depths of subdirectories.

Syntax

Read syntax diagramSkip visual syntax diagram
   .-LISTSUBDIR TRUE-------.   
>>-+-----------------------+-----------------------------------><
   '-LISTSUBDIR--+-TRUE--+-'   
                 '-FALSE-'     

Parameters

TRUE
This is the default. Indicates the files in the subdirectories of the current working directory are listed when processing wildcard searches.
FALSE
Indicates that the files in the subdirectories of the current working directory are not listed when processing wildcard searches.

Examples

Directory /u/user1/xx contains the following files and subdirectory:
areadme (file)
file_xx (file)
readme_xx (file)
ggg (subdirectory)
Directory /u/user1/xx/ggg contains the following files and subdirectory:
file_ggg (file)
zzz (subdirectory)
Directory /u/user1/xx/ggg/zzz contains the following files and subdirectory:
file_zzz (file)
rrr (subdirectory)
The following display shows these files and directories:
250 HFS directory /u/user1/xx is the current working directory
ftp> ls - l
200 Port request OK.
125 List started OK
total 40
-rwx------      1        IBMUSER    0                   48 Oct 29  21:14 areadme
-rwx------      1        IBMUSER    0                   10 Nov  1  16:02 file_xx
drwxrwxrwx      3        IBMUSER    0                 8192 Nov  1  16:00 ggg
-rwx------      1        IBMUSER    0                   23 Oct 29  21:06 readme_xx
250 List completed successfully.
260 bytes received in 0.03 seconds (8.67 Kbytes/sec)
ftp> cd gg
260 HFS directory /u/user1/xx/ggg is the current working directory
ftp> ls - l
200 Port request OK.
125 List started OK
total 24
-rwx------      1        IBMUSER    0                    6 Oct 29  16:00 file_ggg
drwxr-x---      3        IBMUSER    0                 8192 Nov  1  16:01 zzz
250 List completed successfully.
133 bytes received in 0.02 seconds (6.65 Kbytes/sec)
cd zzz
250 HFS directory /u/user1/xx/ggg/zzz is the current working directory
ftp> ls - l
200 Port request OK.
125 List started OK
total 24
-rwx------      1        IBMUSER    0                    4 Nov 29  16:00 file_zzz
drwxr-xr-x     3        IBMUSER    0                 8192 Nov  1  16:01 rrr
250 List completed successfully.
133 bytes received in 0.01 seconds (13.30 Kbytes/sec)
If you have coded LISTSUBDIR FALSE in the server's FTP.DATA file or specified SITE NOLISTSUBDIR, the client sees the following display:
257 "/u/user1/xx" is the current working directory
ftp> ls *
200 Port request OK.
125 List started OK
areadme
file_xx
readme_xx
250 List completed successfully.
29 bytes received in 0.02 seconds (1.45 Kbytes/sec)
If you have coded LISTSUBDIR TRUE in the server's FTP.DATA file or specified SITE LISTSUBDIR, the client sees the following display:
257 "/u/user1/xx" is the HFS working directory
ftp> ls *
200 Port request OK.
125 List started OK
areadme
file_xx
ggg/file_ggg
readme_xx
250 List completed successfully.
42 bytes received in 0.04 seconds (1.05 Kbytes/sec)
When spanning subdirectories with the wildcard *, the file ggg/file_ggg is shown. However, the file ggg/file_zzz is not shown because the subdirectory span is only one level deep.

Restriction: The LISTSUBDIR statement applies to z/OS UNIX file operations only. MVS™ data set operations are not affected.

Related topics

For more information about the following topics, see z/OS Communications Server: IP User's Guide and Commands:
  • ls
  • mget
  • mput
  • mdelete
  • glob
  • site for the LISTSUBDIR option
  • locsite for the LISTSUBDIR option