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

In INITIALIZE what is Repalcing Word will do

1 Answers   CTS,


Write a program to concert an Indexed file into Sequential file?

1 Answers   Covansys,


How to code fscode 10 in cobol program? Where yoy code in your pgm?give ans for the question.

2 Answers   IBM,


hi dudes.....can any one help me..... what is SET TO TRUE all about,anyway?

1 Answers  


we can use set true for condition names.. similarly can we code set to false in cobol pgm? will it work?

1 Answers  






Should I use STOP RUN in the sub program??why?

6 Answers   Xansa,


Difference between array and sub-script ?

0 Answers   HCL,


have in 100 records in a file i want to read first 3 records and skip next 3 records and agan i want to read 3 records and again i want to skip 3 records...

2 Answers   ITC Indian Tobacco Company, PNP, TCS,


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

1 Answers  


How To move a value to an array using move verb?

3 Answers   IBM,


what is difference between the sysabend and userabend?

2 Answers  


What R 2 of the common forms of the EVALUATE STATEMENT ?

1 Answers   Cap Gemini,


Categories