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

IMS External variables refresh


IBM Mainframe Forums -> IMS DB/DC
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
casgarcia

New User


Joined: 06 May 2009
Posts: 21
Location: Madrid

PostPosted: Tue Nov 17, 2009 2:45 pm
Reply with quote

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
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Tue Nov 17, 2009 5:10 pm
Reply with quote

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
View user's profile Send private message
casgarcia

New User


Joined: 06 May 2009
Posts: 21
Location: Madrid

PostPosted: Tue Nov 17, 2009 5:52 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Nov 17, 2009 6:06 pm
Reply with quote

please reread the cobol docs about the EXTERNAL clause
for example
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3lr31/1.7.2?ACTION=MATCHES&REQUEST=EXTERNAL&TYPE=FUZZY&SHELF=IGY3SH33&DT=20060329140556&CASE=&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRSTHIT#FIRSTHIT

anyway the EXTERNAL <things> are not managed by the host environment
( Initiator, IMS)
but by the COBOL environment initialization stub..

so that the storage areas used for the EXTERNAL <things> will be known only to the cobol environment

IMS/or a non cobol caller will not be interested/involved at all
Back to top
View user's profile Send private message
casgarcia

New User


Joined: 06 May 2009
Posts: 21
Location: Madrid

PostPosted: Tue Nov 17, 2009 7:18 pm
Reply with quote

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
View user's profile Send private message
Gary Jacek

New User


Joined: 17 Dec 2007
Posts: 64
Location: Victoria, BC, Canada

PostPosted: Tue Nov 24, 2009 3:08 am
Reply with quote

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
View user's profile Send private message
casgarcia

New User


Joined: 06 May 2009
Posts: 21
Location: Madrid

PostPosted: Mon Nov 30, 2009 2:09 pm
Reply with quote

Hi Gary Jacek,
Thanks again, for your help, I really appreciate it.

Best regards.
Casmir
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 -> IMS DB/DC

 


Similar Topics
Topic Forum Replies
No new posts how to use Tso outtrap external function All Other Mainframe Topics 8
No new posts JCL with variables JCL & VSAM 1
No new posts JCL Variables JCL & VSAM 1
No new posts reset/clear ALL application profile v... TSO/ISPF 3
No new posts REXX - Adding variables CLIST & REXX 8
Search our Forums:

Back to Top