Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to get calling txn's name in the called txn?Or pgm name?

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

New User


Joined: 01 Jun 2006
Posts: 4
Location: NH

PostPosted: Fri Feb 16, 2007 4:35 am    Post subject: How to get calling txn's name in the called txn?Or pgm name?
Reply with quote

Hi Folks!

Transaction M900 starts program SBC0900.
Transaction TMDS starts program SBCP785.

Transaction MMCP also starts program SBC785 and MMCP is used by several other programs (in other regions) to run SBCP785. One of these transacation/program is M900/SBC0900.


The program SBC0900 starts TMDS as follows -
EXEC CICS START
TRANSID ('TMDS')
FROM (SBMPF-RECORD)
RESP (CICS-RESPONSE)
END-EXEC

In SBCP785 (attached to TMDS txn), how can I make out whether the program was STARTed by M900/SBC0900 or another transaction/program (perhaps in another region)?

Besides M900/SBC0900, the other programs use the following command to start MMCP/SBCP785 -
EXEC CICS
START TRANSID ('MMCP')
FROM (SBMPF-RECORD)
END-EXEC

Any help most appreciated.

Thanks,
PrinceOfPersia2
Back to top
View user's profile Send private message

dineshness

New User


Joined: 25 Dec 2006
Posts: 63
Location: Perambalur

PostPosted: Sat Feb 17, 2007 12:14 am    Post subject: Re: How to get calling txn's name in the called txn?Or pgm n
Reply with quote

If you are invoking the program SBCP785 using LINK or XCTL then the following command can be used to find out the invoking program name...

EXEC CICS ASSIGN INVOKINGPROG(data-area) END EXEC

Quote:
INVOKINGPROG(data-area) returns the 8-character name of the application program that used the LINK or XCTL command to link or transfer control to the current program.


If you invoke the program only using START command, I think the only way is to pass the transaction name also along with your other data by adding a member variable in SBMPF-RECORD to have the transaction name.

Dinesh.
Back to top
View user's profile Send private message
princeofpersia2

New User


Joined: 01 Jun 2006
Posts: 4
Location: NH

PostPosted: Sat Feb 17, 2007 12:22 am    Post subject: Re: How to get calling txn's name in the called txn?Or pgm n
Reply with quote

Thanks Folks!

Dinesh, program SBC0900 invokes SBCP785 by using a START statement.

Passing the value "M900" in a variable defined in SBMPF-RECORD is not an option since the same copybook is used by other transactions besides "M900" to pass information to SBCP785. There is no free variable space available, and if I add a new field to SBCP785, all the other programs would have to be changed too (or atleast recompiled), and these other programs are in other sub-systems which do not belong to our group. The scope just widens up.

Is there another way this can be done?

Any help from anyone greatly appreciated.

Thanks!
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Sat Feb 17, 2007 12:22 am    Post subject:
Reply with quote

Sorry Prince, I've given this some thought and I think I have to agree with Dinesh.......
Back to top
View user's profile Send private message
dineshness

New User


Joined: 25 Dec 2006
Posts: 63
Location: Perambalur

PostPosted: Sat Feb 17, 2007 2:39 am    Post subject: Re: How to get calling txn's name in the called txn?Or pgm n
Reply with quote

Prince,

Try to utilize the CHANNEL option available with START command to exchange data between two programs. To know more about Channel, take a look at the
Quote:
CICS Application Programming Guide
from ibm.com.

From the invoking program, you can code the following to pass the data

EXEC CICS PUT CONTAINER(container-name1)
CHANNEL(channel-name) FROM(SBMPF-RECORD)
END-EXEC

EXEC CICS PUT CONTAINER(container-name2)
CHANNEL(channel-name) FROM(ws-transaction-name)
END-EXEC

EXEC CICS START TRANS-ID
CHANNEL(channel-name)
END-EXEC


In the started transaction, you can code the following to recieve the data

EXEC CICS GET CONTAINER(container-name1)
CHANNEL(channel-name) INTO(SBMPF-RECORD)
END-EXEC

EXEC CICS GET CONTAINER(container-name2)
CHANNEL(channel-name) INTO(ws-transaction-name)
END-EXEC

Dinesh.
Back to top
View user's profile Send private message
princeofpersia2

New User


Joined: 01 Jun 2006
Posts: 4
Location: NH

PostPosted: Sat Feb 17, 2007 2:43 am    Post subject: Re: How to get calling txn's name in the called txn?Or pgm n
Reply with quote

This would again require that all the transactions/programs that invoke SBCP785 will have to code their corresponding START statement with the CHANNEL option. As I had mentioned before, there are some programs in other sub-systems (not owned by us) that will also need to be changed, and that option is not available.
If that option was available, simply coding the START command with RTRANSID(M900) and RETRIEVE INTO data-var RTRANSID, would have been enough.

Thanks for your suggestion though. Can you think of anything else?

Thanks,
Prince

dineshness wrote:
Prince,

Try to utilize the CHANNEL option available with START command to exchange data between two programs. To know more about Channel, take a look at the
Quote:
CICS Application Programming Guide
from ibm.com.

From the invoking program, you can code the following to pass the data

EXEC CICS PUT CONTAINER(container-name1)
CHANNEL(channel-name) FROM(SBMPF-RECORD)
END-EXEC

EXEC CICS PUT CONTAINER(container-name2)
CHANNEL(channel-name) FROM(ws-transaction-name)
END-EXEC

EXEC CICS START TRANS-ID
CHANNEL(channel-name)
END-EXEC


In the started transaction, you can code the following to recieve the data

EXEC CICS GET CONTAINER(container-name1)
CHANNEL(channel-name) INTO(SBMPF-RECORD)
END-EXEC

EXEC CICS GET CONTAINER(container-name2)
CHANNEL(channel-name) INTO(ws-transaction-name)
END-EXEC

Dinesh.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Feb 17, 2007 5:21 am    Post subject:
Reply with quote

Hello,

One way might be to create a new transaction/program for the new requirement. Over time others could be converted to the use new convention. For the initial case you'd have what you need and not be compelled to change and/or re-compile everything.

It would mean dual maintenance for a time, but would avoid the global re-work. The trick would be to get things "converted" sooner rather than later. Often, once the urgency is over, the followup work doesn't happen. . .

Not my preferred way, but sometimes things are such that not everything can be changed at one time.
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 LIBDEF not working in called proc packerm CLIST & REXX 0 Fri Sep 15, 2017 7:22 pm
No new posts Calling CLIST through job and REXX Sahasra K CLIST & REXX 19 Tue Aug 01, 2017 10:25 am
No new posts Could we identify the called modules ... elixir1986 COBOL Programming 5 Fri Jul 14, 2017 1:53 am
No new posts Calling procedure with multiple entri... steve-myers PL/I & Assembler 5 Fri Jan 27, 2017 3:33 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us