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
Name some of the examples of COBOl 11?
How did the release of cobol/370 version 1.3 improve the performance of release 1.1?
I have File 1 occurs 5 times with Employee-ID,Employee-Name,Employee-Dept (EEE and MECH). I have File 2 occurs 10 times with Employee-ID,Employee-Name,Employee-Dept (EEE,CIVIL,CHEMICAL and MECH). In FIle 1 and FIle 2 , for matching Employee-DEPT (Only MECH) , we need to move entire records from file1 to file 2. We should not use 2D array. Your help is needed here.
How do you get the data to code the BMS macro?
i want a program using by if, evaluate , string, unstring, perform, occurs?
Define cobol?
What are the various section in data division and briefly explain them.
What are the access modes of START statement?
2 input fles: 2 flat files, with different number of records. both are having unique key for each record and already sorted in ascending order . match these files using unique key and in output only matching key value has to be written. please procide cobol logic
What is the use of intialize verb?
How are the next sentence and continue different from each other?
What is difference between static and dynamic call in cobol?
What are all the divisions of a COBOL program?
can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech
how to refer the data field?