How to delete the records of a dataset through cobol
programme?We should not use jcl utilitities like IDCAMS.

Answers were Sorted based on User's Feedback



How to delete the records of a dataset through cobol programme?We should not use jcl utilitities li..

Answer / janardhan

we can delete by usinf the files concept.

if case of sequential file there is no direct delete option.
for this

1) read the record and rewrite with spaces.
2) read record from one file and write it into another file
by excluding the record which has to be deleted.

if case of indexed file we can directly delete the record
as it contains the indexed no.

same for relative files.

Is This Answer Correct ?    5 Yes 0 No

How to delete the records of a dataset through cobol programme?We should not use jcl utilitities li..

Answer / vivek chandrasekaran

If the file 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.

Syntax for deleting record.

DELETE file_name RECORD

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More COBOL Interview Questions

i want to enter the name 'pandu' into ur table how?

1 Answers   Fidelity,


when COMP-3 is preferrable?

3 Answers   Patni,


How can i write a comp-3 variable into a sequential file should i declara the field in the file description as comp- 3?

1 Answers  


What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?

0 Answers  


what is the diff b/w select stsmt and cursor ?

2 Answers  






I have dataset DS1 which has records say 1 2 3 4 5 ... ... etc And also I have second dataset DS2 whcih has records 1 3 4 5 6 8 .. ... Both the files are sorted and now I want to compare these files and write it into the third files if the records are matching.

4 Answers   FIS, Wipro,


what is meant by binary search?

4 Answers  


What are the different data types in cobol?

0 Answers  


What are INPUT PROCEDURE and OUTPUT PROCEDURE?

0 Answers  


Why IBM?

1 Answers   IBM,


record length in spool?

2 Answers   Infosys,


hai friends ,i have HSBc exam on this sunday,my platform is Mainframe,i have 1 year exp,pls any one send me placement papers of Hsbc and technical questions on mainframe

6 Answers   Citi Bank, CitiGroup, HSBC, iNautix, Wipro,


Categories