reverse order...

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
sairamdarsi@hotmail.com
Member
Posts: 7
Joined: Sun Jan 02, 2011 9:44 am

reverse order...

Post by sairamdarsi@hotmail.com » Wed Mar 23, 2011 3:19 pm

q)write a program display records in reverse order in a flat file...

give any clue....this is my interview question in adp...

MrSpock
Active Member
Posts: 273
Joined: Wed Jun 27, 2007 5:37 pm

Post by MrSpock » Wed Mar 23, 2011 3:44 pm

Read them into an array, then display the array in reverse order.

sairamdarsi@hotmail.com
Member
Posts: 7
Joined: Sun Jan 02, 2011 9:44 am

k..its fine..

Post by sairamdarsi@hotmail.com » Wed Mar 23, 2011 3:53 pm

i know this method...without using array any method

MrSpock
Active Member
Posts: 273
Joined: Wed Jun 27, 2007 5:37 pm

Post by MrSpock » Wed Mar 23, 2011 4:25 pm

Read the data, and write it out with an added field of an incremental sequence count. Sort that output data on the sequence count field in descending order. Now, read that output data. You are now reading it in reverse order. I don't know what more you expect for an answer here.

raju181
Member
Posts: 7
Joined: Tue Mar 15, 2011 3:08 pm

reverse-using sort

Post by raju181 » Sat Apr 02, 2011 12:21 pm

inrec flds=(1,80,seqnum,8,zd)
sort flds=(81,8,zd,d)
outrec flds=(1,80)

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