|
View previous topic :: View next topic
|
| Author |
Message |
casgarcia
New User
Joined: 06 May 2009 Posts: 21 Location: Madrid
|
|
|
|
Hi all,
A Cobol external variable is alive while the run unit that it belong to is alive.
So in a batch job the storage reserved for the external variable will be available during the live of the batch job and this area will be freed when the job ends.
But what is the case when the cobol program is executing under IMS?
The run unit under IMS finish when IMS is stopped, so how can a external varialbe in IMS storage be refreshed without shut down IMS?
Suppose that you want to increas the size of a external varialbe already in IMS storage, how it can be done?
Regards.
Casmir. |
|
| Back to top |
|
 |
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
| Casmir - can you give us an example? Is this a parm - a table(not DB2) - what? Anyway, in most installations the operating system has control, not IMS. IMS should run under the operating system. |
|
| Back to top |
|
 |
casgarcia
New User
Joined: 06 May 2009 Posts: 21 Location: Madrid
|
|
|
|
Example.
Let be pgmA executing as a subroutine in the execution of IMS transaction TrnA.
Program A
Identification division.
Program-id: pgma.
Data division.
Working-storage section.
10 VAR1 pic x(8) EXTERNAL.
Procedure division.
move 'abcdefgh' to VARI1.
Goback.
As far a I know when pgmA is executed it will reserve 8 bytes of memory in IMS, the content of this variable is abailable to any program executed under IMS that declare in its working a EXTERNAL variable called VAR1. It doesn't matter if the program belong to TrnA transaction or don't.
I think this is like this because the IMS is the "first caller" in all transactions so the run unit is alive as long as IMS is alive, and External variables are available in a run unit that is all pgm executed under IMS.
Suppose that I modify pgmA and the external VAR1 is now defined as
PIC x(10).
According with IBM when pgmA is refreshed and executed again will fail because there is an inconsistent definition of VAR1. (In one hand IMS has in memory 8 bytes associated to VAR1 but in the other hand when pgmA is executed with new modification It will reefer to VAR1 as 10 bytes instead of 8.)
So before "upload" pgmA with the new modification it is needed delete the IMS area reserved to VAR1.
How this deletion can be done?
Reagars.
Casmir. |
|
| Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10903 Location: italy
|
|
| Back to top |
|
 |
casgarcia
New User
Joined: 06 May 2009 Posts: 21 Location: Madrid
|
|
|
|
Thanks for your response,
I read the pointed Link but it doesn't clarify my doubt.
As far as I know the run unit in IMS ends when the IMS ends.
i.e.: That's why usually a cobol pgm that process a IMS transaction clean Working-Storage areas before use them.
I thing you are right when you said that IMS are not interested in areas reserved for EXTERNAL, but this areas are not attached to a Cobol program it survived after the program that define it has been finished or canceled. And according with IBM documentation it survives until run unit ends. In IMS run unit is alive until IMS is shutdown.
So how can I delete a External reserved area without shut down IMS? It is posible?
Thans again.
Casmir. |
|
| Back to top |
|
 |
Gary Jacek
New User

Joined: 17 Dec 2007 Posts: 66 Location: Victoria, BC, Canada
|
|
|
|
Hello Casmir
The short answer is that you only need to shut down the IMS Message Processing Regions that service the Transaction Class that was assigned to your Transaction.
So, if your transaction is PART,
Use command "/display tran PART" to determine the transaction class.
Command: /DIS TRAN PART.
TRAN CLS ENQCT QCT LCT PLCT CP NP LP SEGSZ SEGNO PARLM RC
PART 11 3 1 2 65535 7 7 10 0 0 NONE 0
PSBNAME: DFSSAM03
STATUS: BAL( 2)
*2009327/133126*
Then use command "/dis a reg" to determine which MPRs process that class.
Command: /DIS A REG.
REGID JOBNAME TYPE TRAN/STEP PROGRAM STATUS CLASS
7 IMSTMR06 TPE WAITING 1
4 IMSTMR01 TPE WAITING 11
9 IMSTMR03 TPE WAITING 11
JMPRGN JMP NONE
JBPRGN JBP NONE
DBTRGN DBT NONE
IMSTDBRC DBRC
IMSTDLI DLS
*2009327/133306*
Then you only need to recycle those specific MPRs.
In the example above, Transaction PART is in Class 11 serviced by IMSTMR01 and IMSTMR03. |
|
| Back to top |
|
 |
casgarcia
New User
Joined: 06 May 2009 Posts: 21 Location: Madrid
|
|
|
|
Hi Gary Jacek,
Thanks again, for your help, I really appreciate it.
Best regards.
Casmir |
|
| Back to top |
|
 |
|
|