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
What are the various section in data division and briefly explain them.
How can i load all the data from a file to Table (array) in cobol.How i manage the occurs clause with out reading the file.Any options avilable ? Please can any one help me it is urgent?
What is the Purpose of POINTER Phrase in STRING command in COBOL?
i want a program using by if, evaluate , string, unstring, perform, occurs?
Are you comfortable in cobol or jcl?
What are 77 levels used for?
what is search and searchall?what is the diffrence between them?give an best example?
What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?
What rules are followed by the search verb.
what happens if parmparameter passes zero bytes to the program
How many sections are there in data division in COBOL?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?
)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?
How you can read the file from bottom?
if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.