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
Explain the configuration section of a cobol program with examples of syntax.
Is it possible that the redefines clause has different picture clauses compared to the one it redefined?
Name the sections present in data division.
Explain what you understand by passing by value.
Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.
Can we change the password using ALTER? anyone tried and changed?
Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
Have you used comp and comp-3 in your project? And how?
What is rmode(any) ?
System Testing for Mainframe Developers What is System Testing? integration testing ? what's the procedure ..
Why occurs cannot be used in 01 level in COBOL?
What do you understand by psb and acb?
How are the next sentence and continue different from each other?
example for sub strings ? and refernce modifications whit output pls