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

PERFORM ACCUMULATE-TOTALS VARYING A FROM 1 BY 2 UNTIL A >2 AFTER B FROM1 BY 1 UNTIL B>2 AFTER C FROM 2 BY -1 UNTIL C<2 How many times the paragraph ACCUMULATE-TOTALS would be exicuted?

5 Answers   TCS,


Discuss about changing dataset name in proc.

0 Answers  


How do we get current date from system with century?

2 Answers  


What is amode(31)

0 Answers  


how to check whether the open command of a sequential file is successful? or not?

2 Answers   CSC, IBM,






Can we move X(7) to S9(7) COMP?

1 Answers  


how many bytes does a s9(12)COMP-4 field occupy?? a.2 b.4 c.8 d.1 ans with reason please

2 Answers  


what if any ,is the syntex error in the following piece of code 01 B PIC A(7) 02 C PIC 9(4) ........ IF(B NUMERIC) ADD 10 TO C a.the condition in the if statement is wrong b.noting is wrong c.because C is initialised.ADD 10 TO C is wrong d.both B and C shoud have same size.

5 Answers   TCS,


what are the control characters used in reports

1 Answers  


why do u need inspect verb?

3 Answers   Patni,


Can we use icetool in cobol program?

3 Answers  


Name the divisions in a COBOL program ?

7 Answers  


Categories