I have two questions here.
1. How to read a flat file in reverse order?
2. How to read a VSAM KSDS file in reverse order?

In both the cases we donot know the total number of records.

Answers were Sorted based on User's Feedback



I have two questions here. 1. How to read a flat file in reverse order? 2. How to read a VSAM KSD..

Answer / kingmanish

For the KSDS file we can set the pointer on the last record.
After that use the command READ Previous to read the
records in the reverse order.

I am not very sure about flat file. May be we can use a
turn around.
Sort the file in descending order first and then start
reading.

Is This Answer Correct ?    7 Yes 6 No

I have two questions here. 1. How to read a flat file in reverse order? 2. How to read a VSAM KSD..

Answer / hanish

Flat file may be read in reverse order by using the following code

READ file-name into data-name REVERSED.

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More COBOL Interview Questions

What is the size of s9(19)comp3? explain

8 Answers  


How to covert given string into ASCII value in COBOL/MF COBOL

3 Answers   CTS, IBM, iFlex,


When we code these comp,comp1,comp-2,comp-3 and comp4 values. I know the differnece.I mean when we will prefer if it is new program.Explain in detail with memory examples. Thanks in advance.

1 Answers   CTS,


Have you code any new programs in COBOL ? What is the functionality of the programs?

2 Answers   Patni, Xansa,


What are the different ways to run a COBOL DB2 program using JCL?

2 Answers  






Write down the divisions of cobol program?

0 Answers  


Can JUSTIFIED be used for all the data types?

3 Answers  


what is sort? whis is internal & external sort ?when do u go for inter sort & external sort? tell about some sort utilites?

2 Answers   BirlaSoft,


what if any ,is the syntex error in the following piece of code 01 B PIC A(7) 02 C PIC 9(4) ........ IF(B NUMERIC) ADD 10 TO C a.the condition in the if statement is wrong b.noting is wrong c.because C is initialised.ADD 10 TO C is wrong d.both B and C shoud have same size.

5 Answers   TCS,


file status 00 is checked after opening the file or reading the file

4 Answers   John Deere,


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

0 Answers  


how can we find total no of records in a file ....is there any utility......?

3 Answers   IBM,


Categories