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 use of outrecord?
How to print 10 to 1 if the input have only 10 digit number?
please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?
What is the Purpose of POINTER Phrase in STRING command in COBOL?
What are various search techniques in cobol? Explain.
What are the pertinent COBOL
Can you please let me know the centre name of INS certification in Kolkata.
If you are current on the owner of a set, what is the difference between obtain next and obtain first?
Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.
how do you reference the rrds file formats from cobol programs
What are literals?
how to refer the data field?
Explain the configuration section of a cobol program with examples of syntax.
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.
What are the different rules of SORT operation?