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

Invoking MPP program from another MPP program


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

New User


Joined: 19 Oct 2005
Posts: 19

PostPosted: Mon Sep 25, 2006 9:03 pm
Reply with quote

How one MPP pl1 program can invoke another MPP pl1 program?
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Wed Oct 18, 2006 6:27 pm
Reply with quote

Program-to-program switch. Either use ALTPCB or change the transaction code in your SPA.
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Wed Oct 18, 2006 7:47 pm
Reply with quote

Bitneuker wrote:
Program-to-program switch. Either use ALTPCB or change the transaction code in your SPA.


When using ALTPCB you also make a GHNG-call and insert a message for the callee.
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Wed Oct 18, 2006 7:50 pm
Reply with quote

Example of change-call:

DCL ALT_TRX CHAR(8);

ALT_TRX = 'prog to change to';
PARMCT = 3;
CALL PLITDLI (PARMCT,'CHNG',PALTERN,ALT_TRX);
CALL PLITDLI (PARMCT,'ISRT',PALTERN,IOAREA);
Back to top
View user's profile Send private message
Sanjoy

New User


Joined: 19 Oct 2005
Posts: 19

PostPosted: Tue Oct 24, 2006 1:34 pm
Reply with quote

Thank you Bitneuker.

Can you please explian it ,I mean little bit more technical details?

Actually I get that CHNG command will change the Alternate PCB PALTERN and of transaction ALT_TRX.Am I right.
But in the ISRT call which IMS message do we need to put?
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Tue Oct 24, 2006 3:01 pm
Reply with quote

Hi,

this is the complete piece. This message is sent to MPP-prog PBE22. PBE22 uses transaction NPBE22 which is started in the CHNG-call via the ALTPCB. The PBE22 will act on the content of the message (DATA).




DCL 1 IOAREA CHAR(1924);
DCL 1 MID_E0 UNAL BASED(ADDR(IOAREA)),
3 LL BIN FIXED(31),
3 ZZ BIT(16),
3 TC CHAR(09),
3 PFX CHAR(08),
3 CURSOR CHAR(04),
3 PAWO CHAR(08),
3 SYSSPA,
5 SPLITKZ CHAR(1),
5 SECOK CHAR(1),
5 MODUS CHAR(8),
5 PAGE# CHAR(3),
5 MASKE CHAR(5),
5 TCOK CHAR(1),
3 SPA CHAR(50),
3 FEHLER CHAR(79),
3 MASKE1 CHAR(05),
3 MASKE2 CHAR(05),
3 FMASKE CHAR(05),
3 FFUNKT CHAR(01),
3 DATA CHAR(1725);


MID_E0 = '';
DATA = 'blablabla info for PBE22';
LL = 294;
MASKE1 = 'QA';
FMASKE = 'PBE22';
SYSSPA.MASKE = 'QA';
FFUNKT = 'A';
TC = 'PBE22';

DCL ALT_TRX CHAR(8);

ALT_TRX = 'NPBE22';
PARMCT = 3;
CALL PLITDLI (PARMCT,'CHNG',PALTERN,ALT_TRX);
CALL PLITDLI (PARMCT,'ISRT',PALTERN,IOAREA);
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Tue Oct 24, 2006 3:43 pm
Reply with quote

Sorry for the typo-error. In the message TC is filled with 'NPBE22'. not with 'PBE22'. Thus IMS knows the message is for TRX NPBE22.
Back to top
View user's profile Send private message
Sanjoy

New User


Joined: 19 Oct 2005
Posts: 19

PostPosted: Thu Oct 26, 2006 2:38 pm
Reply with quote

Thnaks Bitneuker.

It's working.

But I have got one more question.

After 1st run of the 2nd program some how it is getting stopped. What may be the possible reasons?
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Thu Oct 26, 2006 2:50 pm
Reply with quote

Sanjoy wrote:
Thnaks Bitneuker.

It's working.

But I have got one more question.

After 1st run of the 2nd program some how it is getting stopped. What may be the possible reasons?


I understand the following:

MPP-1 is started, executes the CHNG-call to MPP-2 and sends a message to MPP-2. MPP-2 is invoked and processes the messages. So far so good.

Question: what is MPP-2 supposed to do after the message send by MPP-1 is processed?
Back to top
View user's profile Send private message
Sanjoy

New User


Joined: 19 Oct 2005
Posts: 19

PostPosted: Thu Oct 26, 2006 3:03 pm
Reply with quote

No...Actually MPP2 is getting stopped after 1st run.

In Ims region it is showing

TRAN CLS ENQCT QCT LCT PLCT CP NP LP SEGSZ SEGNO PARLM RC
SN02 12 0 0 10 5 5 5 7 0 1000 4 0
PSBNAME: SN0200
STATUS: BAL( 2),STOP

So subsequent transaction of MMP1 can't invoke MPP2. My Qs is why MPP2 is getting stopped after 1st run?
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Thu Oct 26, 2006 3:25 pm
Reply with quote

Was this MPP-2 started meaning PGM and TRAN are up? Was the region stopped? Please check by typing subsequently:

/DIS REG A.
does the region in which the MPP-2 should run show? If not check SDSF whether the region abended. If it's not active submit the job from SDSF.

/DIS TRAN transactioncode
does is say STOPPED then type /STA TRAN transactioncode

/DIS PROG programname MPP-2
does it say STOPPED then type /STA PROG programname MPP-2
Back to top
View user's profile Send private message
Sanjoy

New User


Joined: 19 Oct 2005
Posts: 19

PostPosted: Thu Oct 26, 2006 6:27 pm
Reply with quote

Thanks Bitneuker.

Actually my problem is After 1st invokation of the MPP-2 it is getting stopped somehow. So rest of the invokation by MPP-1 is getting failed.

Now content of MPP2 is only a display.

Can you tell me when a transaction is stopped by IMS? Then I think i can get the problem.
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Thu Oct 26, 2006 6:52 pm
Reply with quote

I assume you invoked MPP-1 with a transactioncode. So it starts running. After it completes the CHNG- and ISRT-call MPP-2 is started. What happens next. Normally MPP-2 reads the messagequeue to retrieve the message MPP-1 has sent. Did MPP-2 report the QC statuscode telling there are no more messages? I have no clue what this MPP-2 is supposed to do next. Please tell me what it does, or should do? Just telling it stopped somehow brings no light. We need the reason and therefore more information.

You tell me it shows a display which you must have found out by looking in the SDSF (A) showing the regionjob. There you should find if and for what reason MPP-2 was stopped.

If this kind of troubleshooting takes too long by posts I'd better send you my phonenumber in a PM (just did so). Please consider our working hours at Greenwich Time (here the time is 15.19 o'clock now).
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Thu Oct 26, 2006 7:17 pm
Reply with quote

A transaction may be stopped by IMS when a (programmed) failure is detected. The reason is shown in the regionjob which can be looked at via SDSF. Together with the transaction also the program is stopped. See prior post.
Back to top
View user's profile Send private message
Sanjoy

New User


Joined: 19 Oct 2005
Posts: 19

PostPosted: Thu Oct 26, 2006 7:20 pm
Reply with quote

Actually my intention is MPP1 should only invoke MPP2. No IMS mesage sending is required.
What I did in my 1st program:
MPP1 : Proc ($LTM,$PGM) Options(Main);
DCL LTM ptr;
%INCLUDE TPPCB; /* IMS I/O PCB MASK*/
Dcl WF CHAR(21000) BASED;

dcl 1 SqlCa,
%include SQLSTATE;

dcl $PGM ptr;
dcl PGM ptr;
PGM = $PGM;
dcl SN_TRAN char(8) init('');
DCL 1 IMS_MSG,
%INCLUDE XXXXXX;;

SN_TRAN = 'SN02';
Put skip list('calling PLITDLI for change ALP');
CALL PLITDLI(C3,'CHNG',PGM,SN_TRAN); /* Change Alternate PCB */
put skip list('status code from plitdli',substr(pgm->wf,11,2));
Put skip list('calling PLITDLI for change ALP');
CALL PLITDLI(C3,'ISRT',PGM,addr(Ims_msg)); /* Insert Message */
put skip list('status code from plitdli',substr(pgm->wf,11,2));


In the 2nd prog:

MPP2:Proc($ltm) options(main);

DCL LTM ptr;
%INCLUDE TPPCB; /* IMS I/O PCB MASK*/

Put skip list(XXXXXXXXXXXXXXXXXX);

End mpp2;

It seems there is some problem in the MPP2. Is it manditory to receive the message in MPP2? and also If i don't require to send any message what should be the format of the IMS-msg?

Thanks a lot for your help.
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Thu Oct 26, 2006 7:29 pm
Reply with quote

Looks like you forgot the ALTPCB in proc (xx,yy) options main. One of our programs making CHNG-calls:

TPQAVER: PROC (QPIOTRM,QPALTERN,Q
QPNLVERT,QPNLBUEN,Q
QPNLZBNE,QPNLHIDB,Q
QPNLVVER)
OPTIONS(MAIN);

In the corresponding PSB we coded the iopcb is modifyable:

PCB TYPE=TP,MODIFY=YES

Adjust and try again icon_wink.gif
Back to top
View user's profile Send private message
Sanjoy

New User


Joined: 19 Oct 2005
Posts: 19

PostPosted: Thu Oct 26, 2006 7:34 pm
Reply with quote

Also In the Job I am only getting the display XXXXXXXXXXXXXXX

Nothing else
Back to top
View user's profile Send private message
Sanjoy

New User


Joined: 19 Oct 2005
Posts: 19

PostPosted: Thu Oct 26, 2006 7:39 pm
Reply with quote

Yes it is done with ALTPCB. See $PGM pointer in the code.

DO i need to mention it in MPP2 as well.
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Thu Oct 26, 2006 7:40 pm
Reply with quote

When I look at MPP-2 it's all it does.......makes a display and ends just like you programmed. If you want MPP-2 to return control to MPP-1 again you should do in MPP-2 what you did in MPP-1: CHNG control to MPP-1.

Btw: a regulair MPP keeps reading messages to process and communicate with terminals. The way this thing looks it's like a subroutine. Don't see the advantage of this exept if you wanted a proof of concept. icon_confused.gif
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Thu Oct 26, 2006 7:46 pm
Reply with quote

IMS-message:

DCL 1 IOAREA CHAR(xxx);
DCL 1 MID_E0 UNAL BASED(ADDR(IOAREA)),
3 LL BIN FIXED(31),
3 ZZ BIT(16),
3 TC CHAR(09),

3 your info for MPP2 CHAR(????),


MID_E0 = '';
your info for MPP2 = 'blablabla info for PBE22';
LL = ???;
TC = 'transaction';
Back to top
View user's profile Send private message
Sanjoy

New User


Joined: 19 Oct 2005
Posts: 19

PostPosted: Thu Oct 26, 2006 7:51 pm
Reply with quote

Actually All I want MPP2 program should stop after doing some funtion but MPP2 transaction should not be stopped so that it will be available when MPP1 requires to invoke it.
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Thu Oct 26, 2006 7:51 pm
Reply with quote

Sanjoy wrote:
Yes it is done with ALTPCB. See $PGM pointer in the code.

DO i need to mention it in MPP2 as well.


No.....

Looks to me the stuff is doing exactly what you wanted:
invoke MPP-1
chng control to MPP-2
have MPP-2 put data in a display as if it were a subroutine
have MPP-2 terminated.

If you want to proceed processing of MPP-1 or MPP-2 you should make sure there are messages for them on the messagequeue. As long as there are they will process. If no more messages (status = QC) any MPP will stop running until they are (re)invoked by a message on the messagequeue; and this may be the transactioncode sent by the chng-call.
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Thu Oct 26, 2006 7:54 pm
Reply with quote

Sanjoy wrote:
Actually All I want MPP2 program should stop after doing some funtion but MPP2 transaction should not be stopped so that it will be available when MPP1 requires to invoke it.


Transactions do not stop just like that. Did you check with /DIS TRAN mpp2-tran?
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Thu Oct 26, 2006 8:05 pm
Reply with quote

And did you check the region with SDSF (JESMSGLG)?
Back to top
View user's profile Send private message
Sanjoy

New User


Joined: 19 Oct 2005
Posts: 19

PostPosted: Thu Oct 26, 2006 8:15 pm
Reply with quote

Yes and it is showing

TRAN CLS ENQCT QCT LCT PLCT CP NP LP SEGSZ SEGNO PARLM RC
SN02 149 20 0 10 5 5 5 7 0 1000 4 0
PSBNAME: SN0200
STATUS: BAL( 2),STOP
*2006299/164458*
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 Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top