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
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 |
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 |
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?
Discuss about changing dataset name in proc.
How do we get current date from system with century?
What is amode(31)
how to check whether the open command of a sequential file is successful? or not?
Can we move X(7) to S9(7) COMP?
how many bytes does a s9(12)COMP-4 field occupy?? a.2 b.4 c.8 d.1 ans with reason please
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.
what are the control characters used in reports
why do u need inspect verb?
Can we use icetool in cobol program?
Name the divisions in a COBOL program ?