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

What is the diff b/w calling a program using following 2 way


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rameshfoa

New User


Joined: 05 Apr 2007
Posts: 27
Location: chennai

PostPosted: Fri Apr 27, 2007 5:19 pm
Reply with quote

What is the diff b/w calling a program using following 2 ways in CICS program. I believe both are same.

1. EXEC CICS
LINK (pgm1)
END-EXEC

2. CALL 'pgm1'
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Apr 27, 2007 5:28 pm
Reply with quote

The first uses CICS linkage conventions and the connection is dynamic.
The second standatd program linkage conventions and is static.
Back to top
View user's profile Send private message
rameshfoa

New User


Joined: 05 Apr 2007
Posts: 27
Location: chennai

PostPosted: Fri Apr 27, 2007 5:35 pm
Reply with quote

Ok thanks william...yes..it is known that if the program name is hard coded then it is static...and if a variable is used then it is dynamic....but is there any functional difference b/w calling a sub pgm by standard method and CICS LINK method....please explain...
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Apr 27, 2007 5:47 pm
Reply with quote

The first uses CICS linkage conventions.
The second uses standard program linkage conventions.
Back to top
View user's profile Send private message
rameshfoa

New User


Joined: 05 Apr 2007
Posts: 27
Location: chennai

PostPosted: Fri Apr 27, 2007 5:50 pm
Reply with quote

so as a result...if both are going to work in the same way....then what is the use of calling a pgm using LINK....
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Apr 27, 2007 5:56 pm
Reply with quote

rameshfoa wrote:
if both are going to work in the same way
Huh?
The first does not use standard program linkage conventions.
The second does not use CICS linkage conventions.
Back to top
View user's profile Send private message
rameshfoa

New User


Joined: 05 Apr 2007
Posts: 27
Location: chennai

PostPosted: Fri Apr 27, 2007 5:56 pm
Reply with quote

Yes i found the reason...

Under older releases of CICS, Call statements were rarely used because called programs couldn't issue anyCICS commands. Because of that, the use of LINK commands became the norm in many COBOL shops. Even though this restriction has been lifted, many shops continue to use LINK commands. One reason for this is that you can use the LINK command to invoke a program on either a local or a remote system. A Call statement can only invoke a program on a local system.

If you don't need to invoke programs on remote systems, though, the Call statement can be more efficient than the LINK command in some situations. In particular, the Call statement is more efficient if it invokes the same program more than once within a single execution of the invoking program. If you use the LINK command, memory is allocated to the linked program and its working storage is initialized each time the
command is issued. In contrast, memory is allocated to a called program and its working storage is initialized only the first time it's called.

Thanks william icon_biggrin.gif
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Apr 27, 2007 5:58 pm
Reply with quote

rameshfoa wrote:
Thanks william
icon_confused.gif
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
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 DB2 Event passed to the Application P... DB2 1
Search our Forums:

Back to Top