Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

File size problem

Status
Not open for further replies.

royinfo

Programmer
Oct 21, 2009
3
0
0
CA
I'm working on a IBM PC Serveur 325.

I have a sequential file with more than 800000 records. The size of that file is 136755200. I wrote a cobol program (RM cobol) to delete records. Now the file has 180000 records and the size still the same 136755200. What I need to do to decrease the size. (need to save spaces)

After deleting records why it keep the same space?

Thanks

Alain
 
I have no experience with the particular software/compiler you are using, but generally with a sequential file, when records are deleted they are simply "marked" as deleted. It would take a lot of system overhead and be very slow to "move up" all of the records after each deleted record to fill the gaps where they were. The best way to defragment the file would be to copy all of the remaining records into a new file, and then replace the old one.

Annihilannic.
 
On the accucobol that is part of the stuff I support there is a tool supplied that accomplishes the shrinkage.
I would suspect that there is a similar tool with RMCOBOL although a quick search didn't turn anything up.
And be aware that the generation of the new file will eat up a considerable amount of space, so you may be worse off for a while.

Ed Fair
Give the wrong symptoms, get the wrong solutions.
 
Hello edfair,

in accucobol what is the name of the tool that you use to to do a file shrinkage ?

Thanks
 
vutil -r -3 FILENAME

-r for rebuild
-3 for accucobol version

active records from FILENAME are written to a VTMPxxxx file and at completion you accept the new one to be renamed and the old one disappears. If you decline the rename the TMP file remains.

Ed Fair
Give the wrong symptoms, get the wrong solutions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top