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
How did the release of cobol/370 version 1.3 improve the performance of release 1.1?
what are decleratives in cobol?
Write a program to explain size error.
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
What are literals?
If you are current on the owner of a set, what is the difference between an obtain next and obtain first? Actually in which topic will we use dis???Plz explain it clearly
In COBOL, what is the different between index and subscript?
What are the different rules for performing sort operation?
What are the different rules of SORT operation?
When is inspect verb is used in cobol?
What are the different rules to perform a Search?
Whats the difference between search & search ALL?
How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that
input 1 input2 ouput1 output2 output 3 1 re 300 1 re 200 1 re 300 3 rc 500 1 re 200 2 rr 400 1 re 300 2 rr 400 1 rc 400 3 rc 500 1 rc 400 2 rr 700 2 rr 700 5 tt 900 5 tt 900 2 inputs r in flat file and output 1 is matched records,ouptput2 is unmatched of input1,output3 is unmatched of input2! how vl u get the output files using sequential order and to check with each and every records! let me know the procedure division ?
What is the difference between a binary search and a sequential search what are the pertinent cobol?