Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

wirte a pgm in using files in which we hav 10 ,20,30 40...100
records in inputfile and i want them to be send to outputfile
in reverse order.
PLZ HELP ME OUT .........THIS IS A RECENT QUESTION IN IGATE..

Answer Posted / quasar chunawala

However, if there are a fixed no. of records, as you have
mentioned in the question - which may not always be the
case with Production Files(They may contain millions of
records), you may follow this approach.

1. Read all the records into a COBOL array(table) A
(1,2,...10).
PERFORM VARYING I FROM 1 BY 1 UNTIL I>10
READ INPUT-FILE
MOVE INPUT-RECORD TO WS-RECORD(I)
END-PERFORM.

2. Print the data from the COBOL Array into Output-file.
PERFORM VARYING I FROM 10 BY -1 UNTIL I<1
WRITE WS-RECORD(I)
END-PERFORM.

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

1209


What is the LINKAGE SECTION used in COBOL?

1530


What is the Purpose of Pointer in the string?

1081


What are INPUT PROCEDURE and OUTPUT PROCEDURE?

1300


What is static and dynamic call in cobol?

1070


IF I mention stop run in CICS what happens?

2379


what is difference between cobol and cobol/400

22928


What is the utilization of copybook in cobol?

1194


Write a program to enter and display the names of students in a class using the occurs clause.

1208


How did the release of cobol/370 version 1.3 improve the performance of release 1.1?

1083


What is an in line perform? When would you use it? Anything else you wish to say about it.

1076


Difference between array and sub-script ?

1662


please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?

2472


What is the use of intialize verb?

1255


Write a cobol program making use of the redefine clause.

1184