I have a sequential file of 100 records. How do I load the
records into a two dimensional array ?
Answer Posted / ameet
The answer for this is as below:
01 INPUT-REC.
02 REC-DETAIL OCCURS 100 TIMES INDEXED BY I.
03 REC-DATA PIC X(10 ) - assume
PROCEDURE DIVISION.
READ FILE(INPUT) INTO(WORK-REC) - assume length as 100
SET I TO 1.
PERFORM 1000-WRITE 100 TIMES
STOP RUN.
1000-SECTION.
MOVE WORK-REC TO REC-DATA(I).
SET I UP BY 1.
READ FILE(INPUT) INTO(WORK-REC).
| Is This Answer Correct ? | 2 Yes | 16 No |
Post New Answer View All Answers
Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning
How to use the same COBOL program in Batch and CICS on lines? explain with an example
What is difference between static and dynamic call in cobol?
Whats the difference between search & search ALL?
Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.
What are the different open modes available in cobol?
What is the usage of comp fields in cobol?
What is cobol?
input= ,,,, mainframe training ,,, hyderabad .... location.... output1=$ mainframe training in hyderabad location$ output2=**** mainframe training in hyderabad location ****. In this pgn when we give input considering the spaces the output is displayed in this format.Like in the place of ,,,, $ should be displayed likewise.So please helpmeout.
What is the difference between external and global variables in COBOL?
How to know whether the module is dynamical or statistical?
how to access the file from prodution from changeman tool and to submit a file to production
how do you reference the fixed unblock file formats from cobol programs
What is comp-1 and comp-2?
Write a program that uses move corresponding.