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
IF I mention stop run in CICS what happens?
What is the use of intialize verb?
Explain the configuration section of a cobol program with examples of syntax.
What is the compute verb? How is it used?
Write a program to enter and display the names of students in a class using the occurs clause.
Write a program to explain size error.
what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.
What are declaratives and what are their uses in cobol?
What are the various section in data division and briefly explain them.
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.
How can we find that module can be called – whether DYNAMICALLY or STATICALLY?
How you can read the file from bottom?
Can a Search can be done on a table with or without Index?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?
example for sub strings ? and refernce modifications whit output pls