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 is an in line perform? When would you use it? Anything else you wish to say about it.
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
What are the different data types in cobol?
If you are current on the owner of a set, what is the difference between an obtain next and obtain first? Actually in which topic will we use dis???Plz explain it clearly
how can we apply for HSBC exam(Mainframe) in India??? i went to their site and was told to submit my CV ,. etc..( totally confusing...)
What is the problem of ordered sequential files access?
Write the code to count the sum of n natural numbers.
If you are current on the owner of a set, what is the difference between obtain next and obtain first?
How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?
What is the utilization of copybook in cobol? Could we utilize a similar copybook?
i made it to stage 3 of an interview process wednessday they will quiz my knowledge again face to face for an analyst role recruiter said it will be based on Business requirements system is cobol and good ideas what they might ask etc
What is redefines clause in COBOL?
Explain how to differentiate call by context by comparing it to other calls?
) how do u code after getting data?
Mention the guidelines to write a structured cobol program?