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 cobol?

1238


input= ,,,, mainframe training ,,, hyderabad .... location.... output1=$ mainframe training in hyderabad location$ output2=**** mainframe training in hyderabad location ****. In this pgn when we give input considering the spaces the output is displayed in this format.Like in the place of ,,,, $ should be displayed likewise.So please helpmeout.

2220


What guidelines should be followed to write a structured cobol prgm?

1144


Can a Search can be done on a table with or without Index?

1285


What is comp-1 and comp-2?

1225


Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?

1348


What is a SSRANGE and NOSSRANGE?

1461


What are all the divisions of a COBOL program?

1210


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

1337


What is the utilization of copybook in cobol?

1181


What is the difference between PIC 9.99 and 9v99 in COBOL?

1327


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

2469


What are the different data types in cobol?

1429


Difference between cobol and cobol-ii?

1268


What is the use of intialize verb?

1243