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

CALL verb in COBOL/CICS programs?


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

New User


Joined: 28 Apr 2008
Posts: 1
Location: Pune

PostPosted: Wed Apr 30, 2008 11:14 am
Reply with quote

Hi,
I don't have any exposure to CICS environment, so this question may sound silly, sorry for that. I could not get answers from anywhere, hence posting here.

We can use CALL verb in COBOL/CICS, however we dont get to see this. we only see this being handled by LINK/XCTL. why?
Is there any limit in using CALL in COBOL/CICS? like whether called module can have CICS instruction or not? whether this called module need to be registered in CIC control tables?
Can we relate STATIC and DYNAMIC with CALL,LINK and XCTL?
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Wed Apr 30, 2008 12:06 pm
Reply with quote

as far as I know Link and XCTL are dynamic.

you can force CALL dynamic using a working field with the name of the program to be called .

CALL w-nameofprogram USING copybook
CALL 'nameofprogram' USING copybook

in this point read for the DYNAM compiler option.

you can use CALL to invoke programs with CICS sentences...BUT take care as the DFH blocks are inserted in the Procedure division (by the CICS traductor) as: PROCEDURE DIVISION USING dfheiblk dfhcommarea and if not done properly the arguments could be misplaced...

hth
Back to top
View user's profile Send private message
kalukakkad

New User


Joined: 10 Mar 2005
Posts: 81

PostPosted: Wed Apr 30, 2008 3:10 pm
Reply with quote

Some more points of using 'CALL' over 'LINK/XCTL'


1) 'Call' uses less number of instruction than 'LINK/XCTL', hence faster.

2) When using 'Call' in CICS, the CICS TRACE will not show any entries (drawback),whereas LINK/XCTL will have an entry. Useful in debugging.

3) LINK/XCTL requires PPT entry for the called program. But if the called program does not have any CICS instructions, there is no need for a PPT entry and you use 'CALL'.
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Wed Apr 30, 2008 3:48 pm
Reply with quote

and...... beware of using EXEC CICS RETURN in a called program when the caller has invoke it using CALL instead of LINK.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Apr 30, 2008 8:06 pm
Reply with quote

kalukakkad wrote:
3) LINK/XCTL requires PPT entry for the called program. But if the called program does not have any CICS instructions, there is no need for a PPT entry and you use 'CALL'.
With autoinstall, you do not need the PPT entry, it will be created for you.
With a dynamic CALL, again, a PPT entry will be created.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Apr 30, 2008 8:47 pm
Reply with quote

Some cautionary observations -

If the Caller is defined as THREADSAFE in the PPT, the called program better be THREADSAFE as well. Otherwise, you're going to have some "opportunities". icon_wink.gif

If the Caller is accessing the Called program "STATICALLY", then then Caller needs to pass their own WS as a parameter to the Called program and allow the Called program to use the Caller's WS as its own (defined to LINKAGE). This is especially true with THREADSAFE but it can also rear its ugly head in a non-THREADSAFE run-unit.

One final note is that the CALL verb does not invoke MVS services, even though you've specified the called sub-program in a variable, but it's not DYNAMIC. CICS uses it's own method to locate the target sub-program via a PPT lookup.

COBOL/CICS programs must always specify the NODYNAM compile option.

Regards,

Bill
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top