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 different open modes available in cobol?
how do you define single dimensional array and multidimensional array in your cobol?
How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that
Our issue is there seems to be a disconnect, or no link, between our SELECT statement and our SD. We had SELECT SORT-FILE and SELECT SORT-FILE ASSIGN TO SORTWRK. ASSIGN TO SORTWRK1 SORTWRK2 SORTWRK3 SORTWRK4. with SD SORT_FILE RECORD CONTAINS 7833 CHARACTERS. In either case, at run time, the system ignored our SORTWRK# DD statements and allocated 16 sort works with the SORTWK## naming convention. Any ideas why the system does not recognize the connection? We do not even need the SORTWRK DD statements. Thanks
How you can characterize tables in cobol?
What are the different rules to perform a Search?
What are the rules of the move verb?
what is difference between cobol and cobol/400
what happens if parmparameter passes zero bytes to the program
How can you get the ksds file records into your cobol program?
What are the access modes of START statement?
How are the next sentence and continue different from each other?
What is amode(31)
) what is the difference between AID and HANDLE AID?
Describe the cobol database components?