Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
If three Main programs are calling one subprogram

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Husna

New User


Joined: 02 Jun 2006
Posts: 49

PostPosted: Thu Sep 28, 2006 10:10 am    Post subject: If three Main programs are calling one subprogram
Reply with quote

Hi all,

I have a small doubt in subroutines concept. Assume that, I have three programs (Main programs) named PGM1, PGM2 and PGM3. These three Main programs are calling one subprogram (SUBPGM) at a time?what will be happened in this case? Please let me know the same?
Back to top
View user's profile Send private message

shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Thu Sep 28, 2006 11:01 am    Post subject:
Reply with quote

my doudt..is
How come all the three programs call the same subprogram at the same time.

Husna, It is logically impossible.
Execution takes place in a single process step by step.
When your main program...for suppose/...calls PGM2, the control moves from main to PGM2. Now main program don't execute ...but waits untill it receives hte control back from PGM2.

At no point.....all three programs don't execute.
There is no TREADING concept in cobol as of JAVA.
clear??

~Vamsi
Back to top
View user's profile Send private message
rocksolid

New User


Joined: 29 Aug 2006
Posts: 21
Location: India

PostPosted: Thu Sep 28, 2006 2:44 pm    Post subject: Re: Doubt in subroutines?
Reply with quote

Hi Vamsi...

I think Husna's question is different.

PGM1, PGM2 and PGM3 are 3 different MAIN programs and they are not calling one another.

These 3 diff programs are calling one sub program at the same time. This is very usual scenario in real time.

whenever MAIN PGM calls, it will get the copy of SUB PGM'S object module only. In this way any number of MAIN PGMS can call this SUB PGM at the same time.

Husna.. is this what u expect?

Corrections welcomed....

Thank you,
Back to top
View user's profile Send private message
Husna

New User


Joined: 02 Jun 2006
Posts: 49

PostPosted: Fri Sep 29, 2006 8:57 am    Post subject: Re: If three Main programs are calling one subprogram
Reply with quote

Hi,

It's clear now... Thanks a lot.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts pointers on using USS and C programs. Pedro All Other Mainframe Topics 0 Wed Oct 04, 2017 4:38 am
No new posts PLI - printing from multiple programs Pedro PL/I & Assembler 8 Fri Sep 08, 2017 6:36 am
No new posts Calling CLIST through job and REXX Sahasra K CLIST & REXX 19 Tue Aug 01, 2017 10:25 am
No new posts Why myself doing Package Bind always ... Susanta DB2 5 Thu Mar 02, 2017 10:47 pm
No new posts Calling procedure with multiple entri... steve-myers PL/I & Assembler 5 Fri Jan 27, 2017 3:33 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us