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
What is the difference between structured cobol programming and object alternativelyiented cobol programming?
example for sub strings ? and refernce modifications whit output pls
Define static linking and dynamic linking.
What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
What is the utilization of copybook in cobol?
what are decleratives in cobol?
Explain about different table spaces.
Write the code to count the sum of n natural numbers.
What is perform what is varying?
How to get the last record in vsam file in cluster? And how can you get the kids file records into your cobol program?
Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning
Which is not true about evaluate statement
What is length is cobol?
how do you reference the fixed unblock file formats from cobol programs