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

Program Link to get TWA in CICS


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
nelson.pandian

Active User


Joined: 09 Apr 2008
Posts: 133
Location: Phoenix, AZ

PostPosted: Tue Feb 07, 2012 12:49 pm
Reply with quote

Hi Experts,

• MQ is calling a program using program ID (PROGRAM1), which is a CICS program and does not have a Transaction.
• PROGRAM1 is calling PROGRAM2 using EXEC CICS LINK. PROGRAM2 has Transaction ID PRO2.
• In PROGRAM2 we are trying to set a pointer and send the data address to PROGRAM3 using TWA.
• But we are not able to achieve this because PROGRAM2 is called via EXEC CICS LINK.

• We can’t use EXEC CICS START (PRO2), because PROGRAM2 will start with the TWA, but the process of PROGRAM1 will end and the control will be back to MQ.
• MQ team is not ready to change their call from PROGRAM ID to TRAN ID.

Can anyone help me how to get TWA in PROGRAM2?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Feb 07, 2012 1:17 pm
Reply with quote

nelson.pandian wrote:
[...]
• MQ team is not ready to change their call from PROGRAM ID to TRAN ID.
[...]


How hard have you tried to do this? Usually it is not the "team" who decides, but their boss, or their boss's boss, etc. If they can't do this, fullstop, then OK. But "not ready" doesn't count if it means a better solution overall, rather than something rather dodgy (if that is what is needed) sitting in the background.
Back to top
View user's profile Send private message
nelson.pandian

Active User


Joined: 09 Apr 2008
Posts: 133
Location: Phoenix, AZ

PostPosted: Tue Feb 07, 2012 1:22 pm
Reply with quote

Hi Bill,

Our MQ team is not permited to change their call from program ID to TRAN ID.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Tue Feb 07, 2012 6:38 pm
Reply with quote

The TWA is defined at the PCT (Transid) level by your CICS Sysprog and/or Tech Support personnel to RDO.

When you issue a LINK to "PROGRAM2", are you specifying the TRANSID option and supplying a value of "PRO2"?

As soon as "PROGRAM2" is invoked, the TWA is allocated (via the TRANSID option) and is initialized to LOW-VALUES.

How are you accessing "PROGRAM3" from "PROGRAM2"?

Accessing the TWA is via the ADDRESS API. But, to ensure you have a valid TWA, use the ASSIGN TWALENG API and ensure the length (a binary-halfword) is not less than the length you're expecting.

If you're trying to send the TWA address to "PROGRAM3" from "PROGRAM2" (after validating that a TWA exists), the only way is to LINK or CALL "PROGRAM3" and it's safer to issue the above TWA API's above and obtain addressability.

But, as soon as transaction "PRO2" terminates, the TWA address is invalid, even though it may have a non-NULL value. So, the TWA address obtained is not valid anymore.

Mr. Bill
Back to top
View user's profile Send private message
nelson.pandian

Active User


Joined: 09 Apr 2008
Posts: 133
Location: Phoenix, AZ

PostPosted: Tue Feb 07, 2012 7:23 pm
Reply with quote

Hi Bill,

Thanks for the reply.
Quote:
When you issue a LINK to "PROGRAM2", are you specifying the TRANSID option and supplying a value of "PRO2"?

We tried calling PROGRAM2 from PROGRAM1 using EXEC CICS LINK. Full systax is given below.

Code:
EXEC CICS                                   
     LINK PROGRAM(PROGRAM1)               
          TRANID('PRO2')                     
          COMMAREA(PROGRAM1-COMMAREA)       
          LENGTH(LENGTH OF PROGRAM1-COMMAREA)
END-EXEC


Now control is passed to PROGRAM2, but TWA is not initiated.

Quote:
How are you accessing "PROGRAM3" from "PROGRAM2"?

PROGRAM2 is calling PROGRAM3 using LINK. In PROGRAM3 assigning the address of TWA to TWA copybook and trying to accessing it.

Can you please let me know how to initiate a transaction using LINK?
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Tue Feb 07, 2012 7:59 pm
Reply with quote

The program-name in the LINK-API you posted is PROGRAM1.

Shouldn't it be PROGRAM2?

Did System personnel add the TWASIZE to the PRO2 Transaction (PCT) definition in RDO?

Mr. Bill
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Tue Feb 07, 2012 10:01 pm
Reply with quote

Something else; Transaction "PRO2" must specify program "PROGRAM2" as its initial program in the PCT definition along with the TWASIZE value.

Mr. Bill
Back to top
View user's profile Send private message
nelson.pandian

Active User


Joined: 09 Apr 2008
Posts: 133
Location: Phoenix, AZ

PostPosted: Wed Feb 08, 2012 10:25 am
Reply with quote

Sorry Bill. My mistake. It was a typo error. The correct code is given below.

Code:
EXEC CICS                                   
     LINK PROGRAM(PROGRAM2)               
          TRANID('PRO2')                     
          COMMAREA(PROGRAM2-COMMAREA)       
          LENGTH(LENGTH OF PROGRAM2-COMMAREA)
END-EXEC

Quote:
Did System personnel add the TWASIZE to the PRO2 Transaction (PCT) definition in RDO?

TWASIZE is allocated to PRO2 - PROGRAM2.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Feb 08, 2012 11:40 am
Reply with quote

The API keyword is TRANSID not TRANID.

In the PCT definition, the program name needs to be DFHMIRS (my mistake) and then internally DFHMIRS will build the LINK API to PROGRAM2 where the TWA should be allocated.

Have Tech Support personnel make the above program name change and then re-install the PRO2 Transid PCT/RDO entry.

However, the manual is somewhat murky on this when the LINK API is Local and not Remote/DPL. So, prior to the LINK API, obtain the SYSID of the Local region via an ASSIGN SYSID API and use the returned SYSID value in the LINK API, keyword SYSID.

Give it a try by placing transid PRO2 under CEDX, the non-terminal version of CEDF and you should get a session. PROGRAM2 should be coded with the ASSIGN TWALENG API and ADDRESS API for TWA length validation and addressability.

Mr. Bill
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Feb 08, 2012 8:15 pm
Reply with quote

I just tested this theory that the TWA would be allocated when the TRANSID is specified in the LINK API and unfortunately, it is not.

I linked to an equivalent of PROGRAM2 from a PROGRAM1 equivalent, specifying the TRANSID and the SYSID in the LINK API and when PROGRAM2 was invoked, the result of the ASSIGN TWALENG API was zero. I had defined a 256-Byte TWASIZE for the PROGRAM2 transid equivalent.

I guess you'll have to find another way around this.... icon_sad.gif

Mr. Bill
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Feb 08, 2012 9:38 pm
Reply with quote

Based upon what I've seen and read in the manuals, you can't get the TWA the way you're calling the program. You could use TD QUEUE, TS QUEUE, or some other way of preserving the data you need -- but TWA won't be usable unless your people change the calling method to use a transaction name that is defined with a TWA.
Back to top
View user's profile Send private message
nelson.pandian

Active User


Joined: 09 Apr 2008
Posts: 133
Location: Phoenix, AZ

PostPosted: Thu Feb 09, 2012 11:18 am
Reply with quote

Thanks a lot Bill and Robert Sample for you time.

Quote:
You could use TD QUEUE, TS QUEUE, or some other way of preserving the data you need -- but TWA won't be usable unless your people change the calling method to use a transaction name that is defined with a TWA


Changed the Program ID call as Transaction name call using START PRO2 command. Now I'm able to initiate TWA in PROGRAM2. For transferring data from PROGRAM2 to PROGRAM1, I'm using TS QUEUE. At last reading the QUEUE from PROGRAM1 and sending information to MQ.

Thanks once again for your comments icon_biggrin.gif
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 Using API Gateway from CICS program CICS 0
No new posts Calling an Open C library function in... CICS 1
No new posts How to 'Ping' a CICS region in JCL CICS 2
No new posts Parallelization in CICS to reduce res... CICS 4
No new posts DB2 Event passed to the Application P... DB2 1
Search our Forums:

Back to Top