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

How to get calling txn's name in the called txn?Or pgm name?


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
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
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
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
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: 3156
Location: Tucson AZ

PostPosted: Sat Feb 17, 2007 12:22 am
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
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
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

Moderator Emeritus


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

PostPosted: Sat Feb 17, 2007 5:21 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
No new posts Calling an Open C library function in... CICS 1
No new posts calling a JCl inside a JCL JCL & VSAM 3
No new posts step by step trace 4 ISPF dialog call... TSO/ISPF 17
Search our Forums:

Back to Top