Page 1 of 1

delete a record in ps file.

PostPosted: Tue Jul 20, 2010 2:08 am
by white-shadow
hi,
i have some records in a ps file and the same record is in ksds file. now i have to do operations in ksds file. like adding of record or deleting of record. now the same update i have to do in the ps file. adding i think will be done in the end of the ps file. but in the case of deleting we cant delete a record from ps file. so what we should do in this case.
this all i have to do with cobol.

Re: delete a record in ps file.

PostPosted: Tue Jul 20, 2010 2:31 am
by Robert Sample
You need to read the entire sequential file, writing the records you want to keep to a second sequential file. The second file will have the added records but not the deleted records.

Re: delete a record in ps file.

PostPosted: Tue Jul 20, 2010 2:44 am
by white-shadow
it means each time i delete a record i have to create another ps file which will contain all the records except the deleted one. i think u r saying the same.

Re: delete a record in ps file.

PostPosted: Tue Jul 20, 2010 3:25 am
by dick scherrer
Hello,

No, not the same. . .

Each time the process is run a new output file would be created, not each time a record is deleted.

It is also questionable that the new output file would not remain in sequence. . .