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


Please Help Members By Posting Answers For Below Questions

input= ,,,, mainframe training ,,, hyderabad .... location.... output1=$ mainframe training in hyderabad location$ output2=**** mainframe training in hyderabad location ****. In this pgn when we give input considering the spaces the output is displayed in this format.Like in the place of ,,,, $ should be displayed likewise.So please helpmeout.

1785


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...)

1931


Explain the configuration section of a cobol program with examples of syntax.

661


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

1908


HOw can I get the negative sign while deduct high value from low value

1792






Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.

1703


what is amode(24), amode(31), rmode(24) and rmode(any)?

705


What are the rules of the move verb?

708


How you can characterize tables in cobol?

721


how do you reference the esds vsam file formats from cobol programs

634


Differentiate between structured cobol programming and object-oriented cobol programming.

669


Define cobol?

866


i have 10 names in an array and my name is one of them also array is not in sorted order i need to display my name using index how will i do this

1000


i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?

897


what is the difference between COBOL2 AND COBOL390?

2455