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
Can we change the password using ALTER? anyone tried and changed?
State the various causes of s0c1, s0c5 and s0c7.
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
Write the code implementing the perform … varying.
example for sub strings ? and refernce modifications whit output pls
How do you reference the fixed block file formats from cobol programs
How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that
Can a Search can be done on a table with or without Index?
what is s000 u4087 error? please give the all error codes in cobol,jcl.
How to know whether the module is dynamical or statistical?
How do define dynamic array in cobol.
What are the pertinent COBOL commands?
System Testing for Mainframe Developers What is System Testing? integration testing ? what's the procedure ..
i want a program using by if, evaluate , string, unstring, perform, occurs?
What is the difference between Global and External Variables?