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

COMMAREA and CHANNELS


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

New User


Joined: 24 Apr 2016
Posts: 4
Location: India

PostPosted: Tue Apr 04, 2017 8:14 am
Reply with quote

Hello All,
Is it possible to pass data from one CICS program to another (using LINK statement) having both COMMAREA as well as a CHANNEL.

The reason why we are exploring this option is due to the fact that the called program could be called from more than one calling program and we want to make sure that the called program is reading from the right channel and we were thinking of passing the channelname via the COMMAREA from the calling program.

Please do let me know your thoughts.

Thanks
kkm
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Tue Apr 04, 2017 8:41 am
Reply with quote

The syntax diagram in the Application Programming Reference manual indicates you may have either a COMMAREA or a CHANNEL option on your RETURN / LINK / ... command, but not both. The Application Programming Guide manual talks about replacing COMMAREA with CHANNEL. The V5.4 Beta Developing Applications manual specifically states that COMMAREA and CHANNEL are mutually exclusive. It is not clear from these manuals what the impact is on the subprogram but based on the fact that the calling program cannot have both COMMAREA and CHANNEL, I suspect there may be issues with attempting to use both in the subprogram.
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 446
Location: USA

PostPosted: Tue Apr 04, 2017 11:30 am
Reply with quote

If you search 'CICS Channels and Containers' on Google, then you'll find lots of useful links. If you go through any of them then you'll find that when you link you can pass the CHANNEL and then in your called program you can do ASSIGN CHANNEL to know which channel was passed. You won't find the concept of passing a channel name via commarea, that's weird.

If you have 2 programs as PROGA and PROGB calling a common program PROG1 with different channels as 'CHANNEL1' and 'CHANNEL2', then:

PROGA:
Code:
EXEC CICS LINK
PROGRAM('PROG1')
CHANNEL('CHANNEL1')


PROGB:
Code:
EXEC CICS LINK
PROGRAM('PROG1')
CHANNEL('CHANNEL2')


PROG1:
Code:
EXEC CICS ASSIGN CHANNEL(WS-CURR-CHANNEL)
END-EXEC.


WS-CURR-CHANNEL will have the value of 'CHANNEL1' if linked from PROGA and it will have a value of 'CHANNEL2' if linked from PROGB.

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

New User


Joined: 24 Apr 2016
Posts: 4
Location: India

PostPosted: Wed Apr 05, 2017 10:12 am
Reply with quote

Thanks Rahul, I have tried it and it meets my requirements.

Thanks Robert. For my knowledge, i will try to test with both the options and see what happens
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2632
Location: NYC,USA

PostPosted: Fri Apr 07, 2017 2:58 am
Reply with quote

If you bother to read go through this reference then you will understand it.Transferring data between programs using channels
This is what you need to know specifically which RahulG31 made it more easier already.
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 FCP channels for z VM and LINUX All Other Mainframe Topics 0
No new posts Disappearing Channels CICS 9
No new posts Porting to Channels and Containers CICS 3
No new posts Performance testing - Channels and Co... Testing & Performance 1
No new posts Problem creating cluster channels Java & MQSeries 4
Search our Forums:

Back to Top