How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?



How to get the last record in vsam file in cluster? And how can you get the ksds file records into y..

Answer / Deepti Kapoor

In VSAM, you can use a sequence-preserved input/output operation with the ASCENDING or DESCENDING keyword to read the last record. If you are using KSDS files, you can follow the steps mentioned in the previous answer.nn For KSDS files, you can get the last record by reading all records and keeping track of the current position (record number), then repositioning to the end.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More COBOL Interview Questions

I have one column say 'X' defined as VARCHAR Can anyone tell me What are the different ways to update this column thru COBOL-DB2 program?

5 Answers  


There are two flat files one having 10 records and other having 5 records. write a cobol pgm to find the duplicate records(matching records)from both files.

1 Answers   Mind Tree,


I want ALL ERROR codes in VSAM

3 Answers   American Express, TCS,


why we are using picture clause in the cobol programs?

2 Answers  


What is diff betn PS and ESDS file? What is the diffrent compiler options in cobol and there discription? What is retrive nth maximum salary from salary DB2 table. Can we redefine COM-3 variable with varchar variable?

4 Answers  


What is length is cobol?

1 Answers  


what are the utilities for load and unload the DB2 tables

1 Answers   L&T,


Write down the divisions of cobol program?

1 Answers  


Which is not true about evaluate statement

1 Answers  


what is the purpose of linkage section?

10 Answers  


what is difference between the sysabend and userabend?

2 Answers  


How you can characterize tables in cobol?

1 Answers  


Categories