Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

what is the use of outrecord?

2226


How to print 10 to 1 if the input have only 10 digit number?

1264


please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?

2479


What is the Purpose of POINTER Phrase in STRING command in COBOL?

1266


What are various search techniques in cobol? Explain.

1079


What are the pertinent COBOL

2576


Can you please let me know the centre name of INS certification in Kolkata.

2249


If you are current on the owner of a set, what is the difference between obtain next and obtain first?

1359


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.

2156


how do you reference the rrds file formats from cobol programs

1589


What are literals?

1149


how to refer the data field?

2285


Explain the configuration section of a cobol program with examples of syntax.

1207


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.

4177


What are the different rules of SORT operation?

1150