How are you updating the UNIX (not USS, for I live in terror of Chris Mason's rants) file? Via JCL? JCL does not do any ENQ on a DD when it allocates via a PATH. You could single thread by allocating a dataset which is vaguely related to the UNIX file. What I might do would be something like:
//STEP EXEC PGM=SOMEPGM //REALDD DD PATH='/some/path/filename',PATHOPTS=...,FILEDATA=TEXT //ENQDDSN DD DISP=OLD,DSN=some.zos.dsn, // UNIT=SYSDA,VOL=REF=SYS1.MACLIB //* OTHER DSNS If you are not opening a DSN, but actually specifying the PATH in the code, such as with an open() or fopen() in C, then you'll need to do the ENQ yourself. I would suggest doing an ISPF compatable lock as describe here: http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ispzpc90/APPENDIX1.1.4 However, I have found an error in this documentation. Where it says the last byte of the enq is 0x01 when OextSysplexAct is ON), the actual value is 0x20. IBM has accepted an RCF on this. You can get most of the infomation you need from the C lstat() function. However, there is no way in C to do an ENQ that I can see. I have code which gets the OextSysplexAct, but in HLASM: MVC OnOFF,initOnOFF L R1_32,CVTPTR USING CVT,R1_32 L R1_32,CVTECVT DROP R1_32 USING ECVT,R1_32 L R1_32,ECVTOEXT DROP R1_32 USING OEXT,R1_32 * * set the OMVS Sysplex indicator MVC SPFenq+11,OEXTFLG1 DROP R1_32 * Isolate the single bit NI SPFenqTo,OEXTSYSPLEXACTV Or do a lockf() in your code http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/EDCLB1B0/3.563 UNIX does not do any sort of "automatic" locking the way that z/OS does ENQing of legacy data sets. -- John McKown Systems Engineer IV IT Administrative Services Group HealthMarkets(r) 9151 Boulevard 26 * N. Richland Hills * TX 76010 (817) 255-3225 phone * [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 > -----Original Message----- > From: IBM Mainframe Discussion List > [mailto:[email protected]] On Behalf Of Donald Likens > Sent: Thursday, April 19, 2012 8:39 AM > To: [email protected] > Subject: USS File Integrity > > I just ran two STCs that updated the same z/OS USS file at > the same time. How do I stop multiple processes from updating > the same z/OS USS file at the same time? > > ---------------------------------------------------------------------- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to [email protected] with the message: INFO IBM-MAIN > > ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN

