ADDITION of two matrix program



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

ADDITION of two matrix program

Postby sidduchezian » Fri Dec 31, 2010 7:08 pm

Cobol program to accept values for two matrices and add the two matrices and display the results of third matrix.
sidduchezian
 
Posts: 6
Joined: Fri Dec 31, 2010 7:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: ADDITION of two matrix program

Postby sidduchezian » Fri Dec 31, 2010 7:09 pm

actually i need the full program for the above question
sidduchezian
 
Posts: 6
Joined: Fri Dec 31, 2010 7:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: ADDITION of two matrix program

Postby prino » Fri Dec 31, 2010 7:14 pm

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.
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 635
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 28 times

Re: ADDITION of two matrix program

Postby Robert Sample » Fri Dec 31, 2010 7:21 pm

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.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: ADDITION of two matrix program

Postby sidduchezian » Fri Dec 31, 2010 7:34 pm

ya atleast gimme me some help
sidduchezian
 
Posts: 6
Joined: Fri Dec 31, 2010 7:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: ADDITION of two matrix program

Postby enrico-sorichetti » Fri Dec 31, 2010 7:55 pm

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 ?
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: ADDITION of two matrix program

Postby sidduchezian » Fri Dec 31, 2010 8:02 pm

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
sidduchezian
 
Posts: 6
Joined: Fri Dec 31, 2010 7:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: ADDITION of two matrix program

Postby enrico-sorichetti » Fri Dec 31, 2010 8:12 pm

a simple google search with "COBOL MATRIX ADDITION" will return quite a few examples
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: ADDITION of two matrix program

Postby sidduchezian » Fri Dec 31, 2010 8:24 pm

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..??
sidduchezian
 
Posts: 6
Joined: Fri Dec 31, 2010 7:05 pm
Has thanked: 0 time
Been thanked: 0 time

Re: ADDITION of two matrix program

Postby enrico-sorichetti » Fri Dec 31, 2010 8:35 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Next

Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post