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

Our issue is there seems to be a disconnect, or no link, between our SELECT statement and our SD. We had SELECT SORT-FILE and SELECT SORT-FILE ASSIGN TO SORTWRK. ASSIGN TO SORTWRK1 SORTWRK2 SORTWRK3 SORTWRK4. with SD SORT_FILE RECORD CONTAINS 7833 CHARACTERS. In either case, at run time, the system ignored our SORTWRK# DD statements and allocated 16 sort works with the SORTWK## naming convention. Any ideas why the system does not recognize the connection? We do not even need the SORTWRK DD statements. Thanks

2910


Write the code implementing the perform … varying.

1013


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

1046


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

2181


Explain about different table spaces.

1047


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

2089


What is rmode(any) ?

1183


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

1174


There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.

1383


How to know whether the module is dynamical or statistical?

1081


How do you reference the following file formats from cobol programs?

1120


Name the sections present in data division.

1175


Which Search verb is equivalent to PERFORM…VARYING?

999


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

1186


Which is not true about evaluate statement

2394