delete a record in ps file.



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

delete a record in ps file.

Postby white-shadow » Tue Jul 20, 2010 2:08 am

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.
white-shadow
 
Posts: 12
Joined: Sat Jul 17, 2010 11:39 am
Has thanked: 0 time
Been thanked: 0 time

Re: delete a record in ps file.

 

Re: delete a record in ps file.

Postby Robert Sample » Tue Jul 20, 2010 2:31 am

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.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 222 times

Re: delete a record in ps file.

Postby white-shadow » Tue Jul 20, 2010 2:44 am

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.
white-shadow
 
Posts: 12
Joined: Sat Jul 17, 2010 11:39 am
Has thanked: 0 time
Been thanked: 0 time

Re: delete a record in ps file.

Postby dick scherrer » Tue Jul 20, 2010 3:25 am

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. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post