I checked IBM knowledge center but could not find any details on scope of a environment variable, that we can set using CEEENV. In one of our CICS module I was trying to pass a value to another module (Control passed through XCTL) through Environment variable. However I found that the variable and its value lost in the 2nd program. I was trying to experiment passing value without a Commarea / Linkage or TSQ method. But it did not work ��
Joined: 14 Jan 2008 Posts: 2504 Location: Atlanta, Georgia, USA
What if you GETMAINed 31-Bit storage, large enough to house all the CEEENV parameters, move these parameters to the GETMAINed area, then pass the ADDRESS OF the GETMAINed area in the XCTL "INPUTMSG" parm or if you have 4-Bytes to spare, store the ADDRESS in the existing commmarea? In either case, define a POINTER to WS and set it to the GETMAINed address.
Then, when the XCTL completes, obtain this ADDRESS from the "INPUTMSG" (or commarea), establish addressability to this ADDRESS (POINTER) in a LINKAGE structure that formats the CEEENV parmdata and you're done.
GETMAINed Storage automatically FREEs at Task Termination, but you can FREE it yourself, after you save the data somewhere (like WS).
Note: The program with which you're XCTLing to must be AMODE 31, RMODE ANY and is most likely in this day and age.