View previous topic :: View next topic
|
Author |
Message |
menonkiran
New User
Joined: 24 Apr 2016 Posts: 4 Location: India
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
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 |
|
|
menonkiran
New User
Joined: 24 Apr 2016 Posts: 4 Location: India
|
|
|
|
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 |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
Back to top |
|
|
|