File size problem

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)

Thanks

Alain

can you read the records and then write them to a new file?

Yes, you can decrease the file size by recreating it.

When you "delete" a record in cobol, the record is only marked deleted, and bypassed by any subsequent "read" statements.
Write your program as:
select old-master
select new-master.

open input old-master, output new-master.
loop
read old-master at end go to eoj.
if "record not to be deleted"
write new-master-record from old-master-record.
go to loop
eoj.
close old-master new-master.
stop run.

When you are satisfied with the contents of new-master, delete old-master, and rename new-master to old-master.