compress a file
Nancy Palmquist
Nancy.Palmquist at vss3.com
Tue Dec 16 07:12:27 PST 2014
On 12/16/2014 8:19 AM, tob at b-e-s-t.com wrote:
>
> One of my transaction files needs to be broken into 2 parts-active/inactive.
> After I write out the inactive I would like to then compress the file.
> But I want to save all the internal fp fields such as @cd, at cb,etc.
> Is there a way to do this when I do a lookup free or any other way?
> thanks
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://mailman.celestial.com/pipermail/filepro-list/attachments/20141216/3173f615/attachment.html>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
Are you familiar with non-filepro files?
The logic to do this is to use the file like a non-filepro file. You
will need two non-filepro files with a map that has 20 characters added
to the front of the file.
One file will be pointing at the existing key file you want to
compress. One will be pointing at a new file - I might make it a key in
the same file but with a qualifier name, like keynew. Then it is easy
to see if it is working correctly.
Get rid of all indexes - remember how they are built.
You will also have to be sure you copy the Zero record to the new file,
there is one in every filepro file.
Make backups of everything before you start.
Then write a quick bit of logic (by the way you could make this do both
things you want at the same time. Compress and archive, just make one
more non-filepro file. But that can be done first to remove all the
archive records in the normal filepro way but you will lose the 20 bytes
of overhead data.)
Then go through the file record by record and copy record zero first to
the new file, then copy every record that has data in the critical
fields. There is no kind of free chain in a non-filepro file so it can
not tell what records are null and what are not so you have to test it
as you go. (BTW if you are making an archive at the same time, copy the
zero record to that file first also.)
That should do it. BTW - do not modify any data, just copy the entire
record to the new file.
I am sure if you understand non-filepro files this will make perfect
sense. Remember a non-filepro file has no overhead bytes so when you
copy the record you get all the bytes copied not just the 21-end bytes
like you do with a filepro file copy.
Relocate the new keys where you want them in the right filepro files.
Then run freechain on the new key files to make sure filepro understands
it correctly. Build indexes on the new key files.
Nancy
--
Nancy Palmquist
Owner
Virtual Software Systems - www.vss3.com
(412) 835-9417
More information about the Filepro-list
mailing list