Solved what is the DCL command to search for a file in a directory

December 22, 2016 at 12:26:31
Specs: Windows 64
I am a newbie exploring VMS DCL , what is the DCL command I can use to search for a file in a directory?

See More: what is the DCL command to search for a file in a directory

Reply ↓  Report •


#1
December 22, 2016 at 13:47:43
Have you looked here:

https://www.itec.suny.edu/scsys/vms...

Chapter 3 looks like it has what your looking for.

MIKE

http://www.skeptic.com/

message edited by mmcconaghy


Reply ↓  Report •

#2
December 22, 2016 at 14:06:06
Thanks! I looked at the link given by you and in the chapter 3. I can list files in the directory, but how do I find one file in the list. DIR command gives me 1000+ files. I just want to see if I have the files starting with a character/file name.
For example : SELECT * FROM WHERE FILE_NAME = 'ABC' OR 'ABC.*' (give me list of all files with name 'ABC.*' or give me file name 'ABC'
Do you know what is the equivalent command for above SQL ?

Reply ↓  Report •

#3
December 22, 2016 at 14:47:07
✔ Best Answer

Reply ↓  Report •

Related Solutions

#4
December 23, 2016 at 08:52:24
Thank you very much for your help! very appreciated

Reply ↓  Report •

#5
December 23, 2016 at 13:11:58
To document the exact command that could be used:

From the master directory for the target disk ( [000000] ) use the command below:

$ Dir [...]abc.*

The above command will generate a list of all files named ABC with or without any extension. in other words if a file is names ABC. it will be displayed. A file with the name ABC.DAT or ABC.TXT will also be displayed. To display files without any "type" (DAT or TXT as listed above), alter the command to be:

$ dir [...]abc. ! note the trailing DOT

Dan


Reply ↓  Report •

#6
December 23, 2016 at 13:34:17
For some strange reason I don't get any hits when I use the command
$ Dir [...]abc.*
%DIRECT-W-NOFILES, no files found.
Although I have many files that start with abc.

Reply ↓  Report •

#7
December 24, 2016 at 05:27:19
If you are looking for files that contain ABC, you must include wildcard characters as shown below:

$ Dir [...]*ABC*. ! note the trailing DOT

The command above will list any files that contain ABC without any extensions.

Adding the $ after the DOT will show all files with ABC in the name with or without extensions.

For your added pleasure... You can use the % wildcard to limit the possibilities as well. The % is a single character wildcard. For example to locate files that are named ABCx where x is a single character, use the command:

$ Dir [...]ABC%. ! note the trailing DOT

Dan


Reply ↓  Report •

Ask Question