MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

passing values from subprogram to main program

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
mfuser
Banned


Joined: 01 Mar 2005
Posts: 105
Topics: 58

PostPosted: Tue Nov 28, 2006 10:47 pm    Post subject: passing values from subprogram to main program Reply with quote

Members,

I am passing two values from a main program to subprogram and in the subprogram i am calculating the sum and displaying it.Is it possible to return the summed value from sub program to main program and then display the sum in the main program. Please help me if any syntax is available if not how to pass values from subprogram to main program.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Nov 29, 2006 6:09 am    Post subject: Reply with quote

mfuser,

SEARCH SEARCH SEARCH is the only answer for you. And the question you asked is a very basic question and yet you ..... Mad

http://www.mvsforums.com/helpboards/viewtopic.php?p=11422#11422

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
anbesivam
Beginner


Joined: 09 Aug 2006
Posts: 66
Topics: 14

PostPosted: Wed Nov 29, 2006 6:20 am    Post subject: Reply with quote

Hi mfuser,

As you are not mentioned about the language, I am explaning with PL1.

Mostly we will use functions for returning values to the calling programs.
For example, you want to calculate X1+X2 and want return the value in SUM1

Code:
RESULT = SUM_FUNCTION(X1,X2,SUM1)
...
...


SUM_FUNCTION:PROC(X1,X2,SUM1) ;
DCL X1 DEC FIXED;
DCL X2 DEC FIXED;
DCL SUM1 DEC FIXED;

SUM1 = X1+X2;

RETURN(SUM1);
END;


Hope this will help you...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group