LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (September 1996, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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' command.


Back to: Top of message | Previous page | Main SAS-L page