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 / krishna
<PROCEDURE DIVISION>
OPEN INPUT <INFILE>.
OPEN OUTPUT <OUTFILE>.
PERFORM <READ-PARA-NAME> UNTILL EOF='Y'.
PERFORM <CLOSE-PARA-NAME>.
================================
READ-PARA-NAME.
READ <INFILE> AT END MOVE 'Y' TO EOF
IF EOF NOT = 'Y'
MOVE INREC TO OUTREC
WRITE OUTREC.
================================
CLOSE-PARA-NAME.
CLOSE INFILE.
CLOSE OUTFILE.
STOP RUN.
Is This Answer Correct ? | 4 Yes | 7 No |
Post New Answer View All Answers
What is the difference between Call and a Link?
Have you used comp and comp-3 in your project? And how?
Explain how you can characterize tables in cobol?
HOw can I get the negative sign while deduct high value from low value
What is the difference between next sentence and continue in cobol programing language?
What is report-item in COBOL?
How can i load all the data from a file to Table (array) in cobol.How i manage the occurs clause with out reading the file.Any options avilable ? Please can any one help me it is urgent?
Define cobol?
What are the different open modes available in cobol?
)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?
how do you reference the rrds file formats from cobol programs
In which area will you utilize 88 level items in cobol?
How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.
When is inspect verb is used in cobol?
What is the default value(s) for an initialize? What keyword will allow for an override of the default?