Searching Groups of Files for Strings
You can use Qedit to search a group of files for a string; we show two very different methods below. Note that either method can be replaced by a single MPEX command, %QEDIT @,List “string”.
FINDIT Job
The first technique is to do a :Listf into a disc file and then have Qedit convert that disc file into a usefile of commands to be finally executed by Qedit. There are three lines to be modified in this job. On each of these lines the key fields have been underlined and a comment has been placed in curly braces.
!job FINDIT,username.account,group {Insert USERID} !comment ************************************************* !comment * * !comment * FINDIT will produce a list of occurrences of * !comment * a given string in a given set of files in a * !comment * single file group (logon group). * !comment * * !comment ************************************************* !comment !comment To use FINDIT, follow these instructions: !comment 1. Text a copy of this sample (/Text FINDIT). !comment 2. Change the JOB command to log on to the !comment group that you wish to search. !comment 3. Change the fileset in the LISTF command if !comment you don't want to search the entire group. !comment 4. Enter the string to search for between the !comment quote characters in the first Change command. !comment Change these quotes to colons if your string !comment contains any quotes. !comment 5. Stream your workfile (:Stream *). !comment !file f=findit;temp;rec=-12,170,f,ascii;nocctl !listf @;*f {Insert FILESET} !run qedit.pub.robelle set autocont on text findit set length 80 dq " " (1/8) dq "FILENAME" (1/8) cq 10 #"_______"# all {Insert SEARCH STRING} cq 1 "L " all shut use * exit !eoj
FINDIT Command File
The second technique is not so different from the first. A :Listf command is used to generate the list of files, but instead of being a job stream, it is a command file which can be executed from your terminal. It takes two parameters: the fileset to be be searched, and the string for which to look. This command file uses MPE/iX syntax, the listf mode (6), and uses I/O Redirection (> ftemp).
parm fileset=@ anyparm string purge ftemp,temp listf !fileset,6 > ftemp /set autocont on /text ftemp /set length 80 /changeq 1 "$include " all /list $include "!string"