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?



Read a flat file and write last but one (I have n records in a file I have to write n-1th) record in..

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

More COBOL Interview Questions

How to use the same cobol program in Batch and CICS onlines ? Please expalin with an example. Thanks in advance.

1 Answers  


study the following code 01 A1 05 B PIC 99 05 C PIC X(4) 01 A2 05 B PIC 99V99 05 C PIC A(4) pick out the valid statement from the following a.A1 and A2 can not have sub-ordinates b.A1 and A2 can have the same sub-ordinates but must have same PIC clause c.there is nothing wrong d.A1 and A2 can have same sub-ordinates provided they are not at 01 level

4 Answers   TCS,


What is the figurative constant in cobol?

1 Answers  


When and how can we use index & subscript ?

2 Answers  


i have a file which contains records like 10,30,90,50,20,40,80,60,70 i want to display these records in reverse order like 70,60,80,40,20,50,90,30,10 please give me the cobol code (do not sort the records)

3 Answers   Cap Gemini, Mind Tree,






Why there is no questions in this column?

6 Answers  


which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad

0 Answers  


how many bytes do SPPPP999 will store?

18 Answers  


HOw can I get the negative sign while deduct high value from low value

0 Answers  


How much salary you are expecting? If they ask in an interview, what we have to tell?

6 Answers   Tech Mahindra, Wipro,


How you can characterize tables in cobol?

0 Answers  


If we use GO BACK instead of STOP RUN in cobol?

1 Answers   Temenos,


Categories