Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

CICS program issuing a CALL statement to subprogram.

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

New User


Joined: 19 May 2011
Posts: 59
Location: India

PostPosted: Fri Dec 21, 2012 6:06 pm    Post subject: CICS program issuing a CALL statement to subprogram.
Reply with quote

Hi, my CICS program is calling a subprogramusing dynamic CALL statement.

CALL WS-SUB-PROGRAM using WS-COPYBOOK.

Please advise if I need to code for ON EXCEPTION/OVERFLOW clause in CALL statement.
I would really appreciate your reply on this.
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8051
Location: East Dubuque, Illinois, USA

PostPosted: Fri Dec 21, 2012 6:14 pm    Post subject:
Reply with quote

ON EXCEPTION/OVERFLOW on a CALL statement in COBOL is used if -- and only if -- the called subprogram cannot be located. So the answer to your question is ... it depends upon YOU. If you ensure the subprogram is always available, then there would be no reason to code ON EXCEPTION or ON OVERFLOW. If you do not ensure that the subprogram is always available, you might want to code ON EXCEPTION or ON OVERFLOW to indicate this problem in some way (since, presumably, the subprogram not being available will affect the results you send back to the screen).

Personally, I've never had a need to use ON EXCEPTION or ON OVERFLOW for a CALL statement -- but then I've only been coding COBOL programs (batch and CICS) for 37 years or so; the need might yet arise.
Back to top
View user's profile Send private message
kunal jain

New User


Joined: 19 May 2011
Posts: 59
Location: India

PostPosted: Fri Dec 21, 2012 6:34 pm    Post subject:
Reply with quote

Thank you so much Robert, for the quick reply icon_biggrin.gif .

I am planning to code in below manner:

CALL WS-SUB-PROGRAM using WS-COPYBOOK.
(Note: SUB-PROG-RETURN-CODE is populated by WS-SUB-PROGRAM)
IF SUB-PROG-RETURN-CODE = '00'
CONTINUE
ELSE
MOVE 'Y' to WS-CALL-FAILED-SUB-PROG
END-IF

As you indicated if ON EXCEPTIOn or ON OVERFLOW is not coded & sub-program is not available, then how will the execution of CALL statemnt will respond based on the above code.
1) Will Calling program will abend disruptly
OR
2) Control will go to ELSE part of above IF logic.

Please advise.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8051
Location: East Dubuque, Illinois, USA

PostPosted: Fri Dec 21, 2012 6:45 pm    Post subject:
Reply with quote

The IF statement would never be executed, so your (2) point is completely irrelevant.

CICS would detect an abend when the program is not found and would kill the transaction, so the CALL statement would be the last line of code executed.

Since there are at least three ways to ensure the program is found (by statically linking the subprogram to the main program or by compiling the subprogram into a link pack area -- or LINKLIST -- load library or by compiling the subprogram into the library used by the CICS region -- which may require a recompile if the program moves from a test to qa or production CICS region), there really should be no reason to use the ON EXCEPTION / ON OVERFLOW structure in your code. But as I said earlier, it depends entirely upon YOU and your site's coding standards and procedures.

And this is really a question you should be posing at your site; since we do not work at your site, we do not know what your site standards are and hence cannot provide definitive answers. At my site, for example, we have a specific LINKLIST library that application programmers can compile subprograms into just for cases like yours -- but not all sites do this.
Back to top
View user's profile Send private message
kunal jain

New User


Joined: 19 May 2011
Posts: 59
Location: India

PostPosted: Fri Dec 21, 2012 6:55 pm    Post subject:
Reply with quote

I am glad to see myself as more confident than before posting my doubt here.
Thank you !!!

This forum is amazingly the best for mainframe users.
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 IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm
No new posts CICS Transaction Timeout Hooman24 CICS 2 Sun Apr 16, 2017 2:16 pm
No new posts Need help in triggering a PL1 module ... Varungv99 IMS DB/DC 0 Fri Apr 07, 2017 10:01 am
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us