helpful procedure to SEARCH prc tables
Richard D. Williams
richard at appgrp.net
Fri Dec 8 10:57:28 PST 2017
Here's a helpful program to search ascii prc tables for a text match.
/usr/local/bin/SEARCH_IT
rm -f /tmp/$USER.txt
for file in `ls -1 $1`; do if grep -q "$2" "$file"; then echo $file >>
/tmp/$USER.txt; cat $file | grep -n "$2" >> /tmp/$USER.txt; echo "" >>
/tmp/$USER.txt; fi; done;
vi /tmp/$USER.txt
(note make this the "for file" line has no carriage returns. the email
wraps it.)
This is hwo you use it;
# cd /appl/filepro/yourfile
# SEARCH_IT "prc.*" "lookup prt ="
or
# SEARCH_IT "prc.*" "\"MY TEXT IN QUOTES\""
It does require all prc tables be in ascii format and that your login
name is set
To see which tables are not is ascii format;
1) cd /appl/filepro/your_file
2) ls -1 prc.* > /tmp/PRC.txt
3) create this in a sample/prc.input. I use r_process/prc.input;
end::end:
@keyR::PUTENV "PFADDWP","OFF":
::debug on:
::fa="/tmp/PRC.txt":
lokfile::import ascii mgr = (fa) r=\n f=\r:
:not mgr:end:
::z=""{mgr(1):
::fb="/appl/filepro/your_file/"{z:
::import ascii rdw = (fb) r=\n f=\r:
::l=""{rdw(1){"";close rdw:
:l eq "":goto lokfile:
::n(4,.0)=DLEN(l):
:mid(l,"1","1") eq "" and mid(l,n,"1") eq "":goto lokfile:
::fc="/tmp/BADPRC.txt":
:'strip off the prc.:mid(z,"1","4")="";z=""{z:
::export ascii bad = (fc) r=\n f=\r:
::bad(1)=""{z:
::goto lokfile:
Now you have identified the files that need to be recompiled with
ABE=ASCII set.
Since we have removed the prc. when writing the /tmp/BADPRC.txt, we can
run this script;
# for file in `cat /tmp/BADPRC.txt`; do /appl/fp/rcabe yourfile $file; done;
Once you run through these prc. file by recording them, all your prc.
tables are searchable.
Hope this helps somebody,
Richard D. Williams
BTW: I have found that this, /appl/fp/rcabe sample -ca, does not
recompile the prc tables into ASCII text.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.celestial.com/pipermail/filepro-list/attachments/20171208/e7db1e59/attachment.html>
More information about the Filepro-list
mailing list