Very true about the automatic switch to the QR TCB for a non-threadsafe CICS function. I guess I should have said that doing that switch is relatively expensive and so really needs to be avoided as much as possible. And I cannot remember exactly when the code switches back to the L8/L9 TCB from the QR TCB. You really don't want to do any "nasty" UNIX code on the QR TCB as it can greatly impact CICS responsiveness. I think the QR and L8/9 switching logic varies depending on the CICS release level and maybe even maintenance.
-- John McKown Systems Engineer IV IT Administrative Services Group HealthMarkets(r) 9151 Boulevard 26 * N. Richland Hills * TX 76010 (817) 255-3225 phone * john.mck...@healthmarkets.com * www.HealthMarkets.com Confidentiality Notice: This e-mail message may contain confidential or proprietary information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. HealthMarkets(r) is the brand name for products underwritten and issued by the insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance Company(r), Mid-West National Life Insurance Company of TennesseeSM and The MEGA Life and Health Insurance Company.SM > -----Original Message----- > From: IBM Mainframe Discussion List > [mailto:IBM-MAIN@bama.ua.edu] On Behalf Of Jan MOEYERSONS > Sent: Monday, March 21, 2011 7:04 AM > To: IBM-MAIN@bama.ua.edu > Subject: Re: fopen and CICS > > On Sat, 19 Mar 2011 06:09:31 -0500, John McKown <joa...@swbell.net> > wrote: > > >I'm not a expert, but I'd look at two possibilities. > Neither am I, but I did a few experiments a couple of years ago. > > > >Another possibility, but more difficult to implement, is to > continue to > >use your UNIX code. This can be done in CICS, but only in > what is called > >an Open Transaction Environment (OTE) or OPENAPI. This > environment runs > >the code on a separate TCB from the normal quasi-reentrant > TCB (QR) that > >most CICS programmers are used to. This requires the program to be > >written to be threadsafe, which restricts which EXEC CICS > functions can > >be used. > I do believe this is not true. One can use any EXEC CICS > command, threadsafe > or not, in a threadsafe program. CICS will switch back to the > QR TCB when it > needs to execute a non-threadsafe command. > > > And requires more careful coding of the program. > Now, this is true. One has indeed to write threadsafe code. > Just declaring a > module threadsafe in the PCT will definitely not make it so... > > This being said, one can use the fopen, fread and fwrite > functions in a CICS > program. And one can do so on regular MVS datasets as well as > on files in the > hierarchical file system. > > There is however an issue when it comes to serialization... > Indeed, any access > to a given file by any given task may and will interfere with > any access from > any other task that wants to access the same file. And it is > up to the > developer to include the proper serialization within the > application program. > > Now, if today you are using this technique in an MPP, then > the serialization > issue may already (partly) have been solved. Indeed, an MPP > will also serve > multiple transaction for different users, although, if my > memory serves me > right, it does this in a different way than CICS does. CICS > dispatches work for > different transactions running in parallel to a number of > TCBs within the same > region, where IMS will serially assign an MPP region to a > transaction and > complete that transaction before assigning the MPP to the next one. > (Someone with a more fresh recollection than my 20+ years old > experience > with IMS can confirm this, please? Thanks!) > > > Cheers, > > Jantje. > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO > Search the archives at http://bama.ua.edu/archives/ibm-main.html > > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html