how to fetch the record before the last record in a cobol
file( its a huge file and if the key field is not known)
Answer Posted / mailid
1.Read the file sequentially
2.For every successful read, move the key field to temp variable
3.when EOF is reached, A separate section should be performed in which Key field should not be moved to temp variable, Now, the temp variable will have key of the previously read record.
Using this, we can do a keyed read on the file to fetch the last but one record.
| Is This Answer Correct ? | 5 Yes | 6 No |
Post New Answer View All Answers
A table has two indexes defined. Which one will be used by the SEARCH?
Discuss about changing dataset name in proc.
how can we apply for HSBC exam(Mainframe) in India??? i went to their site and was told to submit my CV ,. etc..( totally confusing...)
What are the different rules for performing sort operation?
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 is inspect in cobol ?
What is perform what is varying?
Can we change the password using ALTER? anyone tried and changed?
What is the difference between binary search and sequential search?
Write the code to count the sum of n natural numbers.
what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.
What is redefines clause in COBOL?
Mention the guidelines to write a structured cobol program?
what is search and searchall?what is the diffrence between them?give an best example?
Can we redefine the field of x(200) to less than 200?