i have an query

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
amol.bene
Member
Posts: 1
Joined: Wed Aug 23, 2006 11:17 pm

i have an query

Post by amol.bene » Wed Aug 23, 2006 11:19 pm

can we read a file in reverse order?

User avatar
Kalicharan
Moderator
Posts: 31
Joined: Wed Feb 08, 2006 1:51 pm

Post by Kalicharan » Wed Sep 27, 2006 12:39 pm

Hi,

QSAM files can be processed in reverse order using REVERSED keyowrd.

Use REVERSED option of the OPEN statement to process files in reverse order. The file is positioned at the end, and READ statements read the data records in reverse order, starting with the last record. The REVERSED option is supported only for files that have fixed-length records.

We can process VSAM Key Sequenced Data Set (KSDS) via an alternate index in reverse sequence, the order in which VSAM returns records is not the reverse of the order in which the records are returned when the same data set is processed in a forward sequential manner.
Reverse order processing depends on how data stores for an alternate index.
Thanks
Kalicharan

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others