How do you delete specific record using COBOL

I want delete one record from the file that is
50 th record how can we delete ...?

Questions by raju_68

Showing Answers 1 - 30 of 30 Answers

vukoti1229

  • Jun 16th, 2008
 

The file which we are using is VSAm file then we can go for Key mentioned ,
If it is a sequential file we have to read till the 49th record then needs to delete the 50th record, this is the main disadvantage with Sequential files.

dyury

  • Mar 7th, 2010
 

You can use SORT: copy first 49 record to a file

SORT FIELDS=COPY,STOPAFT=49

then copy the rest of the records starting from 51 to another file

SORT FIELDS=COPY,SKIPREC=50

then concatinate them to output file.

  Was this answer useful?  Yes

Why all of discussing as it's not possible. In VSAM we also having KSDS file. In that everyfile stored in Sequence numbers i mean Primary key values. First we have to move 50 to key number and apply delete syntax........... Simple

  Was this answer useful?  Yes

vivek

  • Dec 30th, 2011
 

In case of PS files, we can convert the contents of the files into Table and then we can access them randomly and we can do our deletion also by going to the required occurence.

  Was this answer useful?  Yes

Madhavi Chava

  • Jan 19th, 2012
 

It is NOT possible to delete records of a seq file. If you do not want a specific record to be kept in a seq file any more, all you can do is to modify the contents of the record so that it contains some special values that your program will recognize as deleted (remember to open the file in I-O mode and REWRITE a new record).



  Was this answer useful?  Yes

Hussain

  • Jan 25th, 2012
 

In normal dasds the data cant be deleted where we like
for that ksds vsam files are used there we have option of index and randomly picking of data we want.So by file handling we can delete the 50th record and whatever the record we want to delete.
Hope Im right to some extent.Correct me if i am wrong...

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions