IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

If three Main programs are calling one subprogram


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
No new posts Calling an Open C library function in... CICS 1
No new posts Fetch data from programs execute (dat... DB2 3
No new posts Passing Parameters to Programs Invoke... PL/I & Assembler 5
Search our Forums:

Back to Top