I see there is something called "LOCK MODE IS EXCLUSIVE", but it gives me a INVALID keyword error on compiling . It would be of great help if someone could give a FILE-CONTROL section example of how to specify LOCK.
SELECT IN-FILE ASSIGN INPUTI FILE STATUS INP-STATUS.
SELECT PIPE ASSIGN PIPE
ORGANIZATION IS LINE SEQUENTIAL
ACCESS MODE IS SEQUENTIAL
FILE STATUS PIPE-STATUS.
I want to keep a exclusive lock on the file PIPE until I close the same. [/code]
I cannot do that , my output is a unix file as below, the DISP parameter cannot go with PATH, PATHDISP cannot understand OLD. Any other way in program to put exclusive lock on the UNIX file. Basically I am trying to avoid data comingle since another process is also writing data to this pipe, and sometime the data in the pipe gets corrupted.
//WWCSRSA JOB CLASS=A,NOTIFY=&SYSUID,MSGCLASS=H,REGION=0M
// JCLLIB ORDER=WWCSRS.PROCLIB
//STEP1 EXEC PGM=WRITEPIP
//STEPLIB DD DSN=WWCSRS.PGMLIB,DISP=SHR
//PIPE DD PATH='/u/wwcsrs/.mfxsplunk',
//*INPUTI DD DSN=WWCSRS.SAMPLE.INPUT.FILE,DISP=SHR
//INPUTI DD *
JOSEPH SMITH 02506240
JAMES JONES 12345678
JOHN JACKSON 00987654
Can different JOBs not have different (hfs) names for the pipe?
One way, assuming that it is z/OS JOBs only causing this issue, is to make a // INCLUDE for your pipe definition, which also contains a z/OS dataset with DISP=OLD. The additional dataset will provide the "locking" by not allowing another JOB to be selected whilst another JOB is already running.