GeekInterview.com
Series: Subject: Topic:
Question: 44 of 233

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 ...?
Asked by: raju_68 | Member Since May-2008 | Asked on: May 7th, 2008

View all questions by raju_68

Showing Answers 1 - 10 of 10 Answers
gande

Answered On : Jun 10th, 2008

View all answers by gande

DELETE file-name RECORD

Yes  1 User has rated as useful.
  
Login to rate this answer.
vukoti1229

Answered On : Jun 16th, 2008

View all answers by vukoti1229

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.

Yes  1 User has rated as useful.
  
Login to rate this answer.
rramaiah1

Answered On : Feb 9th, 2009

View all answers by rramaiah1

We cannot delete a perticular record from sequential file.

Yes  4 Users have rated as useful.
  
Login to rate this answer.
Truclu

Answered On : Oct 16th, 2009

View all answers by Truclu

If VSAM file, you can use IDCAMS to copy by count (49)....don't write a program.

  
Login to rate this answer.
dyury

Answered On : Mar 7th, 2010

View all answers by dyury

You can use SORT: copy first 49 record to a fileSORT FIELDS=COPY,STOPAFT=49then copy the rest of the records starting from 51 to another fileSORT FIELDS=COPY,SKIPREC=50then concatinate them to output file.

  
Login to rate this answer.
ramesh4greek

Answered On : Jun 23rd, 2010

View all answers by ramesh4greek

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

  
Login to rate this answer.
vivek

Answered On : 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.

  
Login to rate this answer.

By if condition its possible.

if cond
delete record
............

  
Login to rate this answer.
Madhavi Chava

Answered On : 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).



  
Login to rate this answer.
Hussain

Answered On : 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...

  
Login to rate this answer.

Give your answer:

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

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.