Tony Furnivall wrote:
>
> I'm looking for some pointers on using the MPE name-space version
> of grep (GREP.HPBIN.SYS)
>
> I have a script that identifies compatibility mode KSAM files. I
> want to use GREP to scan the accounts where these files are located
> for any reference to KSAMUTIL (Converting data files from CM KSAM
> to NM KSAM is trivial - converting the JCL infrastructure is a
> pain!). I want to ask GREP to scan all the files in an account...
Try this command file:
parm file_set, search_string, entry_point="main"
# grepem.xeq - uses grep to search a fileset for
# all occurances of a search string
# Tim Ericson
if "!entry_point" = "main"
listfile !file_set,6 > allfiles
!hpfile not_needed, !search_string, print < allfiles
purge allfiles,temp
purge thisfile,temp
deletevar allfiles_eof, record_counter, file_name
else
setvar allfiles_eof, finfo("allfiles","eof")
setvar record_counter, 0
while record_counter < allfiles_eof
input file_name
echo ==========================
echo !file_name
echo --------------------------
print !file_name;page=0 > thisfile
grep.hpbin.sys "-i '!search_string'" < thisfile
setvar record_counter, record_counter + 1
endwhile
endif
HTH!
+-------------------------------------------------------------------+
My mind is my own, as are my ideas and opinions.
My heart, body, and soul, however, all belong to others. Tim.
+-------------------------------------------------------------------+
Tim Ericson tericson DenKor Dental Management Corp.
Sr. Programmer/Analyst at denkor 503-526-4440 (my direct number)
(& Systems Manager) dot com http://www.denkor.com
Programming HP3000s since 1983! Quality dental care since 1970!
+-------------------------------------------------------------------+
UDCs and Command Files: http://www.denkor.com/hp3000/command_files
+-------------------------------------------------------------------+
|