View previous topic :: View next topic
|
Author |
Message |
sudarshan.srivathsav
New User
Joined: 10 Jul 2012 Posts: 24 Location: USA
|
|
|
|
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.
Code: |
FILE-CONTROL.
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] |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10890 Location: italy
|
|
|
|
just use DISP=OLD in the jcl. |
|
Back to top |
|
|
sudarshan.srivathsav
New User
Joined: 10 Jul 2012 Posts: 24 Location: USA
|
|
|
|
Enrico,
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.
Code: |
//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',
// PATHDISP=(KEEP,KEEP),
// FILEDATA=TEXT,DSNTYPE=PIPE,
// PATHOPTS=(ORDWR,OCREAT)
//*INPUTI DD DSN=WWCSRS.SAMPLE.INPUT.FILE,DISP=SHR
//INPUTI DD *
JOSEPH SMITH 02506240
JAMES JONES 12345678
JOHN JACKSON 00987654
|
|
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
I see there is something called "LOCK MODE IS EXCLUSIVE", but it gives me a INVALID keyword error on compiling |
Which Enterprise COBOL manual did you find this in? LOCK MODE is used in a number of COBOL versions, but as far as I am aware it is not available for z/OS Enterprise COBOL. |
|
Back to top |
|
|
|