MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

IMS TM: Sending messages to other Programs

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> IMS
View previous topic :: View next topic  
Author Message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Thu Apr 15, 2004 7:16 am    Post subject: IMS TM: Sending messages to other Programs Reply with quote

I am having a difficult time understanding the concept of "Sending Messages to Other Terminals and Programs" in IMS Transaction Manager (TM). Please help me understand this concept.

We have DB2 as our database and use IMS TM for "conversation". I have a program X that begins execution when a user confirms an action at the front end. After good deal of validations, X does the following:
Code:

CALL "CBLTDLI" USING WSDLI-PURG             
                     WSPCB-MOD-ALT-1         
CALL "CBLTDLI" USING WSDLI-CHNG             
                     WSPCB-MOD-ALT-1         
                     WS-DESTINATION
CALL "CBLTDLI" USING WSDLI-ISRT           
                     WSPCB-MOD-ALT-1       
                     WS-MESSAGE     
CALL "CBLTDLI" USING WSDLI-PURG           
                     WSPCB-MOD-ALT-1       


The WSDLI are 88 fields that have the values that appear after hyphen in the name. Thus, WSDLI-PURG is equal to PURG, etc. The value of WS-DESTINATION is Y. The WSPCB-MOD-ALT-1 has NOT been defined with EXPRESS=YES.

It is confirmed that the above set of DL/I calls will happen twice in that order.

With what I have gathered from the manual, the above set of DL/I calls would work as follows:
    PURG call. IMS messages are composed of various segments. This call tells IMS Transaction Manager (TM) that the message is now
    _________________
    ALL opinions are welcome.

    Debugging tip:
    When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
    -- Sherlock Holmes.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12382
Topics: 75
Location: San Jose

PostPosted: Thu Apr 15, 2004 10:18 am    Post subject: Reply with quote

Cogito,

This is hard to explain but I will try to keep it simple. Let us take this simple example. This is my main IMS Screen. This screen has 4 options to choose from. From the screen shot they are self explanatory. Now I will explain the PURG,ISRT and CHNG calls in detail.


Code:

          MENUT                 KOLUSU INC             04/15/04 08:43:02 D10T7541
                            M A I N   M E N U          PAGE 1 VIEW 1 OF 1
                                                             
       SELECT              PROCESS DESCCRIPTION            TRANSACTION     
                                                             
                    *********** MAIN ***********                       
           _           PRIMARY EMPLOYEE INFORMATION            ABCD
           _           SALARY CODE PARAMETER MAINTENANCE       LMNO
           _           AUDIT TRAIL MAINTENANCE                 PQRS
           _           ANNUAL REPORTS(DELAYED REPORT)          WXYZ
       
Message:ENTER S OR X TO SELECT,  MULTIPLE SELECTIONS INVALID


Now whenever you select any of the option , it involves a series of calls.

The first call will be a CHNG call. here we will be populating the transaction(ABCD,LMNO,..) depending on the selection.

Code:

CALL 'CBLTDLI'  USING FUNCTION-CHNG   
                      ALT1-IO-PCB     
                      W-ALT-TRAN-ID


Upon successful completion of the above call we issue the ISRT call to insert message to ALT-PCB for message switch.

Code:

CALL 'CBLTDLI'  USING FUNCTION-ISRT   
                      ALT1-IO-PCB
                      W-ALT-MSG-IOAREA     


upon successful completion of the above call we issue the PURG call to purge the complete message swithc message.

Code:

CALL 'CBLTDLI'  USING FUNCTION-PURG   
                      ALT1-IO-PCB


After the second call you are presented with new screen based upon the option you have chosen. In the back ground the purg call execuetes and will eventually out of IMS after the successful completion of the PURG call.

The second transaction is activated immediately after the ISRT call.

In the above screen , you have annual reports which is delayed. This transaction takes in the data and just moves them to spool and there is another program which runs every hour and scans the spool for the messages and triggers a batch job to generate the reports.

Coming to your question of PARLIM, it Specifies a new value for the parallel processing limit count of a transaction. parlim# is the maximum number of messages that can currently be queued, but not yet processed, by each active message region currently scheduled for this transaction. An additional region will be scheduled whenever the transaction queue count exceeds the PARLIM value multiplied by the number of regions currently scheduled for this transaction. Valid PARLIM parameters are numeric values from 0 to 32767 and 65535, where 65535 disables transaction load balancing.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Thu Apr 15, 2004 11:47 am    Post subject: Reply with quote

Thank you for the detailed response, Kolusu. I was close too; as far as the meanings of DLI calls are concerned?

Quote:
The second transaction is activated immediately after the ISRT call.


But, isn't that true only if the PCB has been defined with EXPRESS=YES?When I was going through the manual to understand this program-to-program "communication", I interpreted the following (as I have mentioned in my previous post):

Quote:
As the PCB in question does not have EXPRESS=YES, the messages are not made available immediately. They are made available when the program reaches a commit point. This commit point is reached when the program terminates.


Kolusu, let me put the question in a slightly different perspective. Suppose, you have a COBOL program X, which was invoked because a user confirmed an action at the front end. Now, the implementation of the business logic forces you to make a CALL to a program Y, rather than have a PERFORM in X.

IMS TM provides the facility of this message-switching where you can pass a message to a program which will be scheduled. At this point, I am confused.

If you had a simple COBOL CALL, and X needs to call Y twice, then the processing would be in serial fashion. That is, X calls Y once and calls Y again only when the first call is through.

Is this true in case of message-switching too? That is, would Y be invoked the moment there is a message available for it? Or, does X control the availability of messages? The former would be true if the PCB happens to have EXPRESS=YES. If the PCB does not have EXPRESS=YES, then the latter should be true. (This is what I figured from the manual.)

I want to know, if my statements in the previous para correct.

If yes, then PARLIM assumes significance only if Y is invoked as and when the message is available for it. Is this right?
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12382
Topics: 75
Location: San Jose

PostPosted: Fri Apr 16, 2004 5:13 am    Post subject: Reply with quote

Cogito,

oops I forgot to mention that the second transaction is activated immediately after the ISRT call only when PCB in question is defined with EXPRESS=YES and provided that ISRT call was successful.

The main program which issued the call will be running in the background which is not visible to the user. So the normal practise is to terminate the calling program using the PURG call.

If the PCB in question is defined with EXPRESS=NO then the message will be sitting in the IMS message Queue until it is scanned for its timely invocation.

Since IMS/DC works similar to CICS, you will the same transcation being invoked by many users at the same time. This is where the parlim parameter comes into picture.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Fri Apr 16, 2004 6:28 am    Post subject: Reply with quote

Got it, Kolusu. Thank you.

I have two more doubts, as follows.

Suppose, the PCB has been defined as EXPRESS=NO, but the PARLIM has been set to zero. Now, after the first set of DL/I calls are over, another region will be scheduled for the transaction, but, the transaction will not begin as EXPRESS=NO has been specified. After the second set of DL/I calls are over, one more region will be scheduled and, yet, transaction will not begin as EXPRESS=NO has been specified.

But, once the calling program (X) is over, Y would run in two instances simultaneously and independently.

Am I correct?

The other doubt is related to IMS maintenance. How can I find out if an application program has been defined with SCHDTYP=PARALLEL?
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12382
Topics: 75
Location: San Jose

PostPosted: Fri Apr 16, 2004 11:36 am    Post subject: Reply with quote

Cogito,

When a pcb coded with express=no messages are sent to temporary destinations until the program(calling) reaches a commit point.For a nonexpress PCB, the message is not made available for transmission to its destination until the program reaches a commit point. The commit point occurs when the program terminates, issues a CHKP call, or requests the next input message and the transaction has been defined with MODE=SNGL.
Now coming to your next question, when a pcb is defined with express=no and the parlim is set to 0 and you have invoked the transaction twice.

If the PARLIM value is zero and more messages are in the queue, another region can be scheduled. To prevent one transaction from monopolizing all available regions, use the MAXRGN= parameter on the TRANSACT macro. A non-zero value for MAXRGN specifies the number of MPP regions that can be scheduled. In addition, you can use the SERIAL option of the TRANSACT macro to process transactions in the order they arrive. IMS limits the processing to this time sequence. If data required by the transaction is unavailable, this causes IMS to stop scheduling this transaction type.

Quote:

The other doubt is related to IMS maintenance. How can I find out if an application program has been defined with SCHDTYP=PARALLEL?


hmm I have no idea and first thing which comes to my mind is to ask the IMS DBA who might be able to tell you right away. I will try to find it out and will update the post

Hope this helps...

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Fri Apr 16, 2004 12:53 pm    Post subject: Reply with quote

Kolusu,
I had the information about MAXRGN, TRANSACT macro too. But, I am not sure, I understand the sequence of events.

X : Calling program
Y : Called program

After the first set of DL/I calls, X places a message in the queue. If the PARLIM is 0, then another region is scheduled for Y. But, Y does not start until X is over because PCB has been defined with EXPRESS=NO. After the next set of DL/I calls, X places another message in the queue. Once again, another region is scheduled for Y. But, Y does not start until X is over because PCB has been defined with EXPRESS=NO.

When X is over, then Y can use the messages. If above is the sequence of events, then Y is actually executing in two simultaneous and independent instances.

OR :
After the two sets of DL/I calls, X places 2 messages in the queue. Now, since 2 > 0 (PARLIM value), another region is scheduled. After X is over, Y accesses the messages and processes them serially.

Which of the above is correct?

Kolusu, I have gone through the manuals about this program-to-program messaging. And, yet, I keep getting confused. So, I had no option but to post here.[/list]
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> IMS All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group