Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

I have a sequential file of 100 records. How do I load the
records into a two dimensional array ?

Answer Posted / gopal

01 INPUT-REC.
02 REC-ROWS OCCURS 10 TIMES INDEXED BY I.
03 REC-COLS OCCURS 10 TIMES INDEXED BY J.
04 REC-DATA PIC X(20 ) - assume

PROCEDURE DIVISION.
READ FILE(INPUT) INTO(WORK-REC) - assume length as 100
SET I TO 1. SET J TO 1.
PERFORM 1000-WRITE 10 TIMES
STOP RUN.
1000-SECTION.
MOVE WORK-REC TO REC-DATA(I J).
SET J UP BY 1.
READ FILE(INPUT) INTO(WORK-REC).
This will move the 10 occurences of J that is (I 1) to (I
10)
Then the outer loop should be incremented 10 times that is
I from 1 to 10.

Is This Answer Correct ?    12 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which division and paragraphs are mandatory for a COBOL program?

1251


how do you reference the rrds file formats from cobol programs

1552


What is the difference between binary search and sequential search?

1071


Which Search verb is equivalent to PERFORM…VARYING?

1023


Difference between array and sub-script ?

1636


How do define dynamic array in cobol.

1111


2 input fles: 2 flat files, with different number of records. both are having unique key for each record and already sorted in ascending order . match these files using unique key and in output only matching key value has to be written. please procide cobol logic

2580


What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?

1095


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

1128


What is the difference between perform … with test after and perform … with test before?

1413


What is the difference between external and global variables in COBOL?

1437


If you are current on the owner of a set, what is the difference between obtain next and obtain first?

1322


What is the difference between Global and External Variables?

1357


How do you differentiate between cobol and cobol-ii?

1184


how do you reference the printer file formats from cobol programs

1193