Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Throw 2 different maps in same program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
suma_infy

New User


Joined: 03 Oct 2008
Posts: 25
Location: chennai

PostPosted: Tue Mar 22, 2011 10:20 am    Post subject: Throw 2 different maps in same program
Reply with quote

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

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1825
Location: UK

PostPosted: Tue Mar 22, 2011 11:16 am    Post subject:
Reply with quote

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

Active Member


Joined: 08 May 2006
Posts: 995
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Tue Mar 22, 2011 1:30 pm    Post subject:
Reply with quote

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

New User


Joined: 03 Oct 2008
Posts: 25
Location: chennai

PostPosted: Thu Mar 24, 2011 9:11 am    Post subject: Reply to: Throw 2 different maps in same program
Reply with quote

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

Active Member


Joined: 08 May 2006
Posts: 995
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Thu Mar 24, 2011 12:43 pm    Post subject:
Reply with quote

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

Global Moderator


Joined: 06 Jun 2008
Posts: 8117
Location: East Dubuque, Illinois, USA

PostPosted: Thu Mar 24, 2011 2:58 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts Compiling program in endeavor for tra... RALAKKAL Compuware & Other Tools 4 Mon Jun 05, 2017 8:27 pm
No new posts COBOL DB2 program - zIIP eligible vasanthz COBOL Programming 7 Wed May 31, 2017 5:12 am
No new posts DB2 Program abending without giving a... rahulgarg14 DB2 7 Mon May 29, 2017 8:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us