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 / vijay kumar reddy

identification division.
program-id. -------
environment division.
file control.
select infile assign to disky.
organization is sequential.
acess mode is sequential.
select outfile assign to disky1.
organization is sequential.
acess mode is sequential.
data division.
file section.
fd 01 infile.
05 ---
05
fd 01 outfile.
05 ---
05
working-storager section.
77 ws-eof pic 9 value zero.
77 ws-buffer1 pic x(80) value spaces.
77 ws-buffer2 pic x(80) value spaces.
procedure division.
000-main-para.
100-open-para thru 100-exit-para.
200-read-para thru 200-exit-para until ws-eof=1.
300-close-para thru 300-exit-para.
stop run.
100-open-para.
open infile.
open outfile.
100-exit-para.
exit.
200-read-para.
at end.
move 1 to ws-eof.
display buffer1.
not at end.
move buffer2 to buffer1
read infile.
move inrec to buffer2.
read infile.
move inrec to buffer1.
200-exit-para.
exit.
300-close-para.
close infile.
close outfile.
300-exit-para.
exit.

Is This Answer Correct ?    1 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to remove 2 duplicate records and copy only one using job control language?

1219


Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.

2435


how do you reference the variable unblock file formats from cobol programs

1328


What is the difference between structured cobol programming and object alternativelyiented cobol programming?

1241


How are the next sentence and continue different from each other?

1297


Can we change the password using ALTER? anyone tried and changed?

2021


How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?

1246


Name some of the examples of COBOl 11?

3143


How to get the last record in vsam file in cluster? And how can you get the kids file records into your cobol program?

1209


How many bytes S(8) comp field occupy and its maximum value?

2141


What is the problem of ordered sequential files access?

1161


What are all the divisions of a COBOL program?

1219


EXPLAIN MAIN FRAME TESTING PROCESS...HOW TO FIX THE MAINFRAME BUGS?

2548


write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc

1238


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

1334