> -----Original Message----- > From: IBM Mainframe Discussion List > [mailto:[email protected]] On Behalf Of Etienne Thijsse > Sent: Tuesday, July 20, 2010 7:53 AM > To: [email protected] > Subject: fopen mode "w+" on PDS member fails, but "w" succeeds > > Hi, > > Does anyone have an idea why fopen("//PDS(MEMBER)", "w+") > fails, while fopen > ("//PDS(MEMBER)", "w") succeeds? > > What do I have to do to the PDS to make fopen "w+" work? > Change its record > format, record length....? Any idea's? > > Thanks, > > Etienne
I am not an expert, or even very knowledgeable, on C. But I do know PDSes. Based on that knowledge, I do not think you can do this (w+). The reason being that w+ allows both reading and writing. Which is basically "update in place". This is not really possible with a PDS member in this case because w+ could allow addition of new data to the end of the existing member, which could destroy the contents of a different member. I would __guess__ that the C runtime developers decided to err on the side of caution and not allow w+ on a PDS member. "w" is OK because this results in totally new member content, which is written at the end of the PDS, into unused spaced. If you really need to do this, then I think you will need to fopen() with an "r" and read the member into storage, modify it in storage, then fopen() with a "w" to write the member back to the PDS with the same name. -- John McKown Systems Engineer IV IT Administrative Services Group HealthMarkets(r) 9151 Boulevard 26 * N. Richland Hills * TX 76010 (817) 255-3225 phone * (817)-961-6183 cell [email protected] * 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 ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

