retokenize tables

Bruce Easton bruce at stn.com
Tue Jan 23 16:13:33 PST 2007


>Chris Rendall wrote on Tuesday, January 23, 2007 5:59 PM
>
> I'm running filePro 5.0.14 on SUSE Enterprise Linux and it acts like it
> is only using tokenized tables even though I specify dclerk.  Some of my
> processing tables have not been tokenized for a long time since I've
> only been using dclerk/dreport.  Is there a way to automate going
> through all my processing tables and create the tok file?
>
> Thanks,
> Chris
>

Chris - you can use the  -ca  flag combo for rcabe.  This is to retok all
tables in a file, so you would need to set up a script that has your files
listed in it and then edit it to have cabe command in front and the flags at
the end on each line (assuming runtimes are in /appl/fp):

cd filepro
ls -d * >/tmp/myfiles.sh
(to get  a file with one filepro filename on each line)
 then edit with vi:
vi /tmp/myfiles.sh
:g/^/s/^/\/appl\/fp\/rcabe /g<ret>
that should form the beginning of the lines, then
:g/$/s/$/ -ca/g<ret>
that should form the ends of the lines, so that
each line winds up looking similar to:
/appl/fp/rcabe firstfile -ca

then execute the script (/tmp/myfiles.sh)

Of course this might have problems if you have junk other than valid
filepro files in you filepro directory.  To be a bit safer then,
you could then replace the first step above with:
ls */map >/tmp/myfiles
should list one file on each line, but will include /map at end
(this way you are only listing dirs in the filepro dir that have
maps in them)
 then when you vi /tmp/myfiles.sh:
:g/\/map/s/\/map//g<ret>
this should remove the /map at the end of each line, then do the same rest
of editing in vi that I mention above.

Anyway, when it's all done, you can do something like this to verify what
was done:
1. list all prc files at once in time order and write to filea.
2. list all tok files at once in time order and write to fileb.
check 1: all toks should have very recent date and time
3. edit fileb and change all refs of "tok" to "prc":
:g/tok/s/tok/prc/g<ret>
then do a diff between filea and fileb
check 2: look at the result of the diff -
the diff should show where tok don't exist where they should

As far as the flags, I read a page in the Dev. Ref. that we sell, but you
also see this in online help when in Define Menus.  (?For some reason I have
to press F10 twice in many cases to get the help screen to completely draw
and accept further commands like page up/down, search etc. - must be some
termcap problem on my end.?)

If there are large tables involved, check size against your default
PFTOKSIZE, and add a generous -t/-ty on each line as well if needed.

Now someone is going to tell me there is a utility and you don't need all
this old-fashioned stuff:) - I'd like to know:).

Wow - actually I do have a "retok.sh" under my /appl/fp/scripts dir., but it
has a lot of comments and file verification code in it from my former
co-worker, so I'm not sure if there was an original from fp or if this is
totally ours???  Hmmm - I don't see it on a newer box we set up with same fp
version.

Also, I haven't used SUSE Linux, yet, but I'm assuming there is a vi
there???

Bruce Easton
STN, Inc.



More information about the Filepro-list mailing list