sample code for read a 2nd record from last in flatfile how
can do?

Answer Posted / santhosh vayathuri

for this we need to do fallowing steps

1) read all the records and store into an array and count
value store into an var

2) from that array subtract count var by 1 we will get last
2nd record

ex :: array(count-1) == last 2nd rec

Is This Answer Correct ?    1 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

2 input fles: 2 flat files, with different number of records. both are having unique key for each record and already sorted in ascending order . match these files using unique key and in output only matching key value has to be written. please procide cobol logic

2388


What is the usage of comp fields in cobol?

916


What are the pertinent COBOL

2266


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

2639


how we sort two input files based on a common column and giving one o/p file please send me the coding logic?

1923


Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc

1066


i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com

2017


what is search and searchall?what is the diffrence between them?give an best example?

6260


how can we apply for HSBC exam(Mainframe) in India??? i went to their site and was told to submit my CV ,. etc..( totally confusing...)

2167


What is Pic 9v99 Indicates in COBOL?

970


Which mode is used to operate the sequential file?

955


What is length is cobol?

889


How to know whether the module is dynamical or statistical?

890


What is rmode(24)

928


What is the LINKAGE SECTION used in COBOL?

1260