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

USE count of CEMT for static call


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

New User


Joined: 02 Mar 2012
Posts: 48
Location: India

PostPosted: Tue Nov 19, 2013 10:25 pm
Reply with quote

Hello All,

I understand that USE counter of a CICS program that was called in Dynamic mode through main program will increase the USE counter (if we inquire that program via CEMT). May i know whether the USE counter of CICS program will also be increased when it is called in Static mode through main program.

Thanks for replying.
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: Tue Nov 19, 2013 10:37 pm
Reply with quote

Static Calls don't require a PPT entry and therefore, you won't find it when you issue a CEMT INQ PROG(),

If for whatever reason, there is a PPT entry, because Statically Called modules are merged with the caller, suffice to say a CEMT INQ PROG will show a USECOUNT of ZERO.

As a sidenote, be sure to pass re-entrant storage from the Caller to be used in the Statically Called sub-program. Otherwise, when two or more tasks attempting to use the same storage defined in WORKING-STORAGE of the Statically Called sub-program, battle for this storage, you'll windup with some surprising results.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Nov 19, 2013 11:24 pm
Reply with quote

Hello,

Just FYI, but it appears that you asked the same thing twice . . . icon_confused.gif
Back to top
View user's profile Send private message
dudenithy

New User


Joined: 02 Mar 2012
Posts: 48
Location: India

PostPosted: Wed Nov 20, 2013 3:33 am
Reply with quote

Hi Bill, I ll put in this way,, PGM A calls PGM B, I inquire PGM B via CEMT, its USE count is always increasing when ever i initiate PGM A which in turn calls PGM B with the command CALL PGMB USING XXX. In compile option of PGM A, i could see compile option NODYNAM. Hence i confirm PGM B is a static call from PGM A. So i surprise, even for static call, PGM B USE count is increasing. Is that corrrect that even for static call, USE count is getting increased?
Back to top
View user's profile Send private message
dudenithy

New User


Joined: 02 Mar 2012
Posts: 48
Location: India

PostPosted: Wed Nov 20, 2013 3:35 am
Reply with quote

Hello Dick, Did I icon_confused.gif I could see only one icon_smile.gif
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 Nov 20, 2013 6:56 am
Reply with quote

The required compiler option for CICS/COBOL is NODYNAM. So, to determine whether a program is CALLED Statically, it would be a CALL 'LITERAL', whereas, a CALL 'IDENTIFIER' (a WS field with the sub-program name) would be the CICS implementation of a Dynamic Call. The latter is where you'll see the USECOUNT of PGM B increasing as it has it's own PPT entry (CALL 'IDENTIFIER') as it's CALLED from PGM A.

HTH....
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Nov 20, 2013 8:46 am
Reply with quote

Hello,

Quote:
Hello Dick, Did I icon_confused.gif I could see only one icon_smile.gif
The way I read your question, I thought you were asking an OR question and both sides were the same . . .

Sorry 'bout that if I misunderstood.
Back to top
View user's profile Send private message
dudenithy

New User


Joined: 02 Mar 2012
Posts: 48
Location: India

PostPosted: Wed Nov 20, 2013 1:49 pm
Reply with quote

Hi Bill, yes, my PGM A calls PGM B using WS identifier, so as per you, for CICS; its a dynamic call, and thats why USE counter is increased.
My question 1:But do you also agree if PGM A calls PGM B using literal, then USE counter will not increase?

Now comes to long debate on difference between static vs dynamic, what so far i thought was, neverthless if you call PGM B with WS identifier which has value as 'PGM B', compiler option DYNAM or NODYNAM differentiates the call should be static or dynamic.

Before posting this, i have looked again many posts relates to this,

http://ibmmainframes.com/viewtopic.php?t=47347&highlight=call+static+dynamic
one of the reply from Dick in this post is:
When a CALL is made via a WS variable it is not resolved during the linkedit and will be resolved at execution - i.e. dynamically.

To have a good understanding, may i ask you further questions, this post might be helpful for others who also have concerns on this topic icon_smile.gif

2. If call using literal is always static when opion is NODYNAM ?
3. If call using literal is always dynamic when opion is DYNAM ?
4. If call using identifier (pgm name in identifier was declared in Working storage section) is always dynamic neverthless option is DYNAM/NODYNAM ?
5. If call using identifier (pgm name in identifier was populated in procedure division) is always dynamic neverthless option is DYNAM/NODYNAM ?

Thanks for answering icon_smile.gif
Back to top
View user's profile Send private message
dudenithy

New User


Joined: 02 Mar 2012
Posts: 48
Location: India

PostPosted: Mon Nov 25, 2013 4:34 pm
Reply with quote

Hi Bill / Dick,,
awaiting for your reply icon_rolleyes.gif
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Mon Nov 25, 2013 6:09 pm
Reply with quote

1. depends on DYNAM
2,3,4,5. yes,yes,yes,yes

Cobol does not check whether an identifier is variable or constant. hence only "call literal" are candidates for static calls and are by default static calls, unless you override this default by using DYNAM as a compile option. Then these are also dynamic calls.
Code:

                   +---------+---------+
                   | NODYNAM |  DYNAM  |
+------------------+---------+---------+
| call 'literal'   |  Static | dynamic |
+------------------+---------+---------+
| call identifier  | dynamic | dynamic |
+------------------+---------+---------+
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: Mon Nov 25, 2013 6:18 pm
Reply with quote

GuyC,

Compiler option "NODYNAM" must be used for CICS/COBOL programs. The "DYNAM" option is for Batch and invokes z/OS services (IE: an SVC), whereas, "NODYNAM" in CICS/COBOL uses a CICS "Under the Covers" method of a Dynamic Call (using a PPT entry, a "LOAD PROGRAM" API and a VCON) and does NOT invoke z/OS services.

Regards,
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Mon Nov 25, 2013 6:43 pm
Reply with quote

yes, I lost track of "CICS must use NODYNAM" while focusing on static/dynamic thing.
so the answer on 1. is also yes, because NODYNAM is the only possible option.

Thx, Bill
Back to top
View user's profile Send private message
dudenithy

New User


Joined: 02 Mar 2012
Posts: 48
Location: India

PostPosted: Tue Nov 26, 2013 1:38 pm
Reply with quote

Thanks everyone icon_smile.gif It is clear to me now,, hope it will be useful for other guys also who have confusion on this topic icon_smile.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 To get the count of rows for every 1 ... DB2 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
Search our Forums:

Back to Top