Read a flat file and write last but one (I have n records in a file I have to write n-1th) record in another flat file. Could you please provide me the code in COBOL?

Answer Posted / mehak

open input file reversed
this will read file in reversed order
write 2 record

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we redefine the field of x(200) to less than 200?

814


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

1646


Why is it necessary that file needs to be opened in I-O mode for REWRITE?

746


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

741


please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?

1952






Describe the cobol database components?

677


Why occurs cannot be used in 01 level in COBOL?

711


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

694


Write a program that uses move corresponding.

669


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

2729


How do we get current date from system with century in COBOL?

798


I need to compare 3 variables(dates) and do some processing based on the earliest date. There could be more then 1 date record in any of the 3 fields. What is the best way to code this?

1802


Mention the guidelines to write a structured cobol program?

617


What is an in line perform? When would you use it? Anything else you wish to say about it.

642


Discuss about changing dataset name in proc.

757