Date: Mon, 9 Sep 1996 12:12:12 PDT
Reply-To: Melvin Klassen <KLASSEN@UVVM.UVIC.CA>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Melvin Klassen <KLASSEN@UVVM.UVIC.CA>
Subject: Re: VM/CMS Search Tool?
"Prasad Ravi USAET(UTC -04:00)" <pravi@E-MAIL.COM> writes:
>I was wondering if there is any COMMAND or SEARCH TOOL to search for a
>character string in all files of VM/CMS operating system.
>I have about 500 files, which needs to be searched for a particular string.
1. Start console-spooling ('CP SPOOL CONSOLE START').
2. Invoke the 'FILELIST' command, to show a list of all your files.
3. Move the cursor to the "command-line", and enter:
EXECUTE * PIPE < / | CASEI LOCATE ?TARGET? | COUNT LINES | LITERAL / | CONS
i.e., for each file in the file-list,
read the file, do a case-independent search for the string 'TARGET',
count the lines, insert the name of the file,
and write two lines to the console, i.e., the name of the file,
and the number of occurrences of the string.
4. Terminate console-spooling ('CP SPOOL CONSOLE TO * STOP CLOSE'),
to capture a record of the lines which 'EXECUTE' wrote to your console.
Note: I assume that you are using VM/ESA CMS, which contains the 'PIPE'