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 |
What are VS COBOL 11 special features?
What are all the divisions of a COBOL program?
What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?
I have two questions here. 1. How to read a flat file in reverse order? 2. How to read a VSAM KSDS file in reverse order? In both the cases we donot know the total number of records.
how do you move only numeric data from A to B 01 A pic x(10) value 'a1b2c34d5e'. 01 B pic x(5).
Can you please let me know the centre name of INS certification in Kolkata.
In A cobol program , we can use COPY Statement in FILE- SECTION / WORKING-STORAGE SECTION / ENVIRONMENT DIVIION basically what is the difference
Hi All, how is sign is stored in S9(17) comp-3 variable. Answer with an Example will be of great help.
How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?
what do you mean by copybook? and what is the difference between the copybook which we are using in working storage and procedure division.
Define cobol?
How can i write a comp-3 variable into a sequential file should i declara the field in the file description as comp- 3?