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 / lakshmi

1) iN WORKING STORAGE SECTION, Declare 2 variables HOLD-REC
and PRV-REC Equal to length of file and initialize them to
spaces
2) In Procedure divison, use the below logic and at the end
of the file read, PRV-REC contains the record before the
last record

READ <INFILE>
NOT AT END
MOVE HOLD-REC TO PRV-REC
MOVE INREC TO HOLD-REC
AT END
MOVE 'Y' TO EOF
END-READ

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Whats the difference between search & search ALL?

6539


What are the different rules of SORT operation?

1146


what is difference between cobol and cobol/400

22929


How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that

3234


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

1151


what is amode(24), amode(31), rmode(24) and rmode(any)?

1154


What is the difference between external and global variables in COBOL?

1469


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

1206


input 1 input2 ouput1 output2 output 3 1 re 300 1 re 200 1 re 300 3 rc 500 1 re 200 2 rr 400 1 re 300 2 rr 400 1 rc 400 3 rc 500 1 rc 400 2 rr 700 2 rr 700 5 tt 900 5 tt 900 2 inputs r in flat file and output 1 is matched records,ouptput2 is unmatched of input1,output3 is unmatched of input2! how vl u get the output files using sequential order and to check with each and every records! let me know the procedure division ?

2305


What is the difference between PIC 9.99 and PIC9v99?

1342


Write some characteristics of cobol as means of business language.

1145


Write a cobol program making use of the redefine clause.

1186


What is static and dynamic call in cobol?

1070


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

1164


What are the various section in data division and briefly explain them.

1188