View previous topic :: View next topic
|
Author |
Message |
suma_infy
New User
Joined: 03 Oct 2008 Posts: 25 Location: chennai
|
|
|
|
Hi All,
I have PRG A which is associated with the transaction TRN1. PRG A is designed in such a way that it should display 2 different maps. PRG A is XCTLed by PRG 1. PRG A receives the data via commarea from PRG1 and displays the first map. It is running in the Pseudo-conversational mode. It returns the control with trans id TRN1 so that PRG A will be invoked upon the user input.
After validating the user input, PRG A needs to display the second Map. I want the same PRG A to be invoked when user selects any thing in the second map as well. Can i return the control with trans id TRN1 for this map as well?
My doubt is already TRN1 has already invoked PRG A and PRG A is running. Can i give the same instruction(return with trans id TRN1 while throwing the second map) again?
Thanks,
Suma |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
How far did you manage to throw the map? One sends maps.
Ideally you should have one program per unit of work - 2 maps suggest 2 units of work. However, you can return to your tansaction as many times as you want - you just need to remind yourself as to which map was last sent - maybe a map id within the map data or a counter within the COMMAREA? |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
Quote: |
have PRG A which is associated with the transaction TRN1. PRG A is designed in such a way that it should display 2 different maps. PRG A is XCTLed by PRG 1. PRG A receives the data via commarea from PRG1 and displays the first map. It is running in the Pseudo-conversational mode. It returns the control with trans id TRN1 so that PRG A will be invoked upon the user input.
|
This doesn't seem to make sense. Either TRN1 executes PRGA or PRG1 XCTLS to PRGA. If TRN1 executes PRGA, then how can it receive anything from PRG1?
Garry. |
|
Back to top |
|
|
suma_infy
New User
Joined: 03 Oct 2008 Posts: 25 Location: chennai
|
|
|
|
The program flows like this...
1. PRG1 XCTLs PRGA -
(in which PRGA receives data from the PRG1. Say PRG1 is associated with transaction TRN2.)
2.PRGA receives the data and displays the data in the MAP(first map). PRG A executes the Return statement with the Transaction TRN1.
3. TRN1 is defined to invoke PRG A.
4. When the user enters any value in the first map, it will enter into PRG A.
5. After validating the user input, PRGA will display another new MAP(second map).
My doubt is whether return statement can have same transaction TRN1 when displaying the second map so that PRGA will again be invoked for processing the user input in the second map as well.
let me know if any thing is not clear.
Thanks. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
|
|
|
|
You can keep invoking TRN1 from PRGA. Possibly the most common pseudo-conversations are a transaction (TRN1) which invokes a program (PRGA) passing a COMMAREA in which some setting is used control the flow in PRGA. In this case, for example, TRN1 might check COMMAREA field for W-MAP-NUM and decide which map to display from this.
A common practice is to use EIBCALEN=0 as a test for 'first-time-in'.
Garry. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
My doubt is whether return statement can have same transaction TRN1 when displaying the second map so that PRGA will again be invoked for processing the user input in the second map as well. |
If you paid money for a CICS course, you were robbed. Very common logic used in CICS programs is
Code: |
PROCEDURE DIVISION USING ...
IF EIBCALEN = 0
set COMMAREA-FLAG to 1
send map 1
EXEC CICS RETURN TRANSID('xxxx') COMMAREA(COMMAREA)
END-IF
IF COMMAREA-FLAG = 1
set COMMAREA-FLAG to 2
receive map 1
process map 1
send map 2
EXEC CICS RETURN TRANSID('xxxx') COMMAREA(COMMAREA)
END-IF
IF COMMAREA-FLAG = 2
receive map 2
...
|
|
|
Back to top |
|
|
|