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

How you can read the file from bottom?

1084


I have one ps file in which there are 3 fileds emp_no,emp_name and leave_app.this ps file information give the detail of employee which is going to apply for leave.suppose emp_no=113430,emp_name=ajay,leave_app=1 that means he is going to apply for 1 day leave.and accordingling the table in db2 will be updated means if he has that no of leave in his account then he will get dat leave and updated acc. in table(leave_balance=previous leave present in table-leave_app).Now i want to check whther the updated result is correct or not by comparing the two ps file using IEBCOMPARE or icetool so what is going to be the two ps file and how its is going to be compare.

2392


How to remove the spaces at the end of each record in the output file of variable length, via cobol program?

1108


Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?

1055


Is it possible that the redefines clause has different picture clauses compared to the one it redefined?

1102


What is amode(24)?

1187


How many sections are there in data division in COBOL?

1079


explain sorting techniques in cobol program?

1145


how do you reference the variable unblock file formats from cobol programs

1279


What is the difference between PIC 9.99 and 9v99 in COBOL?

1244


What is inspect in cobol ?

1241


When is inspect verb is used in cobol?

1180


how to refer the data field?

2209


Define cobol?

1312


How are the next sentence and continue different from each other?

1225