Page 1 of 2

ADDITION of two matrix program

PostPosted: Fri Dec 31, 2010 7:08 pm
by sidduchezian
Cobol program to accept values for two matrices and add the two matrices and display the results of third matrix.

Re: ADDITION of two matrix program

PostPosted: Fri Dec 31, 2010 7:09 pm
by sidduchezian
actually i need the full program for the above question

Re: ADDITION of two matrix program

PostPosted: Fri Dec 31, 2010 7:14 pm
by prino
I can provide a PL/I program, just transfer EUR 1,200 to my Paypal account, and you'll have it next week. If you need it today, that's also possible, just transfer EUR 2,400.

Re: ADDITION of two matrix program

PostPosted: Fri Dec 31, 2010 7:21 pm
by Robert Sample
This is a HELP forum, not a DO-THE-WORK-FOR-YOU forum. As prino said, if you want work done for you, be prepared to pay the going rate for professional coding. We will help you with questions but generally, you do the work.

Re: ADDITION of two matrix program

PostPosted: Fri Dec 31, 2010 7:34 pm
by sidduchezian
ya atleast gimme me some help

Re: ADDITION of two matrix program

PostPosted: Fri Dec 31, 2010 7:55 pm
by enrico-sorichetti
ya atleast gimme me some help


remember, replying is
on voluntary base
our own time
our own equipment
free of charge
benevolence factor toward the <requester>

toward somebody who does not show any effort to help himself
the benevolence factor is almost 0 ( zero )

where are You facing issues, the logic or the coding ?

Re: ADDITION of two matrix program

PostPosted: Fri Dec 31, 2010 8:02 pm
by sidduchezian
no sir actually i got the logic.. that using the occurs class we have to declare and using perform until we have get values... am stuck in coding part.. please help

Re: ADDITION of two matrix program

PostPosted: Fri Dec 31, 2010 8:12 pm
by enrico-sorichetti
a simple google search with "COBOL MATRIX ADDITION" will return quite a few examples

Re: ADDITION of two matrix program

PostPosted: Fri Dec 31, 2010 8:24 pm
by sidduchezian
IDENTIFICATION DIVISION.
PROGRAM-ID. MAT-ADD.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 MAT1.
02 MR1 OCCURS 5 TIMES.
03 MC1 PIC 99 OCCURS 5 TIMES.
01 MAT2.
02 MR2 OCCURS 5 TIMES.
03 MC2 PIC 99 OCCURS 5 TIMES.
01 MAT3.
02 MR3 OCCURS 5 TIMES.
03 MC3 PIC 99 OCCURS 5 TIMES.
01 ROW1 PIC 99.
01 ROW2 PIC 99.
01 COL1 PIC 99.
01 COL2 PIC 99.
01 I PIC 9.
01 J PIC 9.
PROCEDURE DIVISION.
MAIN-PARA.
DISPLAY " MATRIX ADDITION ".
DISPLAY "*****************************".
DISPLAY "ENTER ORDER OF MATRIX-1".
ACCEPT ROW1.
ACCEPT COL1.
DISPLAY "ENTER ORDER OF MATRIX-2".
ACCEPT ROW2.
ACCEPT COL2.
IF ((ROW1 NOT = ROW2) AND (COL1 NOT = COL2))
DISPLAY "CANNOT ADD THE MATRICES"
ELSE
PERFORM COMP-ADD.
STOP RUN.
COMP-ADD.
DISPLAY "ENTER ELEMENTS OF MATRIX - 1".
PERFORM ACC1 VARYING I FROM 1 BY 1 UNTIL I>ROW1
AFTER J FROM 1 BY 1 UNTIL J>COL1.
DISPLAY "ENTER ELEMENTS OF MATRIX - 2".
PERFORM ACC2 VARYING I FROM 1 BY 1 UNTIL I>ROW2
AFTER J FROM 1 BY 1 UNTIL J>COL2.
PERFORM MATADD VARYING I FROM 1 BY 1 UNTIL I>ROW1
AFTER J FROM 1 BY 1 UNTIL J>COL1.
DISPLAY "ADDED MATRIX ".
MOVE 20 TO LIN.
MOVE 30 TO COL.


IS this coding correct..?
i wanna know whether there is any inbuilt function in cobol to add matrix..??
and what does
MOVE 20 TO LIN.
MOVE 30 TO COL.
this signify..??

Re: ADDITION of two matrix program

PostPosted: Fri Dec 31, 2010 8:35 pm
by enrico-sorichetti
IS this coding correct..?

what happened whe You compiled it

i wanna know whether there is any inbuilt function in cobol to add matrix..??

did anybody teach You the use and the meaning of the words please and thank You ?
looks like not :evil:

if you wanna know, read Yourself the effing manual!

for the most current
Shelf: Enterprise COBOL for z/OS V4R1 Bookshelf
http://publibz.boulder.ibm.com/cgi-bin/ ... s/IGY3SH40

for the previous one
Shelf: Enterprise COBOL for z/OS V3R4 Online BookShelf
http://publibz.boulder.ibm.com/cgi-bin/ ... s/IGY3SH33