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

what happens if parmparameter passes zero bytes to the program

2143


What guidelines should be followed to write a structured cobol prgm?

1162


For rewrite, why is it mandatory that file needs to be opened?

1121


In COBOL programming, what is PERFORM? What is VARYING?

1156


How can we find that module can be called – whether DYNAMICALLY or STATICALLY?

1243


How do we get current date from system with century in COBOL?

1388


I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?

1654


) How do u handle errors in BMS macro

2061


What is the utilization of copybook in cobol? Could we utilize a similar copybook?

1234


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

2384


Define static linking and dynamic linking.

1205


how can i see junk values in dclgen or in hostvariable of comp ?

3006


I have a File that has duplicate records. I need only those records that occur more than thrice.?

9904


What is perform what is varying?

1187


What rules are to be followed while using the corresponding options?

1087