HP3000-L Archives

August 1998, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Tim Ericson <[log in to unmask]>
Reply To:
Tim Ericson <[log in to unmask]>
Date:
Thu, 20 Aug 1998 09:23:26 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (51 lines)
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
 +-------------------------------------------------------------------+

ATOM RSS1 RSS2