View previous topic :: View next topic
|
Author |
Message |
dudenithy
New User
Joined: 02 Mar 2012 Posts: 48 Location: India
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Just FYI, but it appears that you asked the same thing twice . . . |
|
Back to top |
|
|
dudenithy
New User
Joined: 02 Mar 2012 Posts: 48 Location: India
|
|
|
|
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 |
|
|
dudenithy
New User
Joined: 02 Mar 2012 Posts: 48 Location: India
|
|
|
|
Hello Dick, Did I I could see only one |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
dudenithy
New User
Joined: 02 Mar 2012 Posts: 48 Location: India
|
|
|
|
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
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 |
|
Back to top |
|
|
dudenithy
New User
Joined: 02 Mar 2012 Posts: 48 Location: India
|
|
|
|
Hi Bill / Dick,,
awaiting for your reply |
|
Back to top |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
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 |
|
|
dudenithy
New User
Joined: 02 Mar 2012 Posts: 48 Location: India
|
|
|
|
Thanks everyone It is clear to me now,, hope it will be useful for other guys also who have confusion on this topic |
|
Back to top |
|
|
|