| View previous topic :: View next topic |
| Author |
Message |
rsantosh Beginner
Joined: 20 Dec 2014 Posts: 44 Topics: 10
|
Posted: Thu Oct 16, 2025 12:23 pm Post subject: JCL file lock |
|
|
Hello, I have a JCL which has 1st step as wait of 5 minutes. In the next step it reads a file. When I run the job and try to create the same file when the job is in wait period of 5 minutes and next step has not started executing, I sill get dataset contention. Does the job locks the dataset even though the step where it is used has not started executing?
Step01 makes the job wait for 5 minutes. While job is in wait status (STEP02 hasn't started yet) i tried to create HLQ.TEST but received contention. We have JES2. Will I get same issue with JES3? | Code: | //STEP01 EXEC PGM=ZEKESET
//SYSIN DD*
SET WAIT 300
/*
//STEP02 EXEC PGM=IEFBR14
//DD01 DD DSN=HQL.TEST,DISP=SHR |
|
|
| Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12397 Topics: 75 Location: San Jose
|
Posted: Thu Oct 16, 2025 10:49 pm Post subject: |
|
|
rsantosh,
DISP=SHR will NOT cause an exclusive lock. Some other job/user is holding the job. When you received contention message , issue the command shown below and press enter. It will show the EXCLUSIVE lock in RED
| Code: |
DDLIST E 'dataset.name.here' |
_________________ Kolusu
www.linkedin.com/in/kolusu |
|
| Back to top |
|
 |
rsantosh Beginner
Joined: 20 Dec 2014 Posts: 44 Topics: 10
|
Posted: Thu Oct 16, 2025 11:36 pm Post subject: |
|
|
I submitted the job and while it was in wait status, I issues the ddlist e command. The job didn't have exclusive lock on HLQ.TEST but when I tried to create the dataset with 3.2 I received below message, the jobname shown by the message is the same job which I submitted and was in wait step. | Code: | DATASET IS ALLOCATED TO ANOTHER JOB OR USER
IEFA110I DATA SET CONTENTION
DATA SET HLQ.TEST IN USE BY
SYSNAME JOBNAME ASID
XXXX HLQ1 XXXX | Regards,Santosh |
|
| Back to top |
|
 |
rsantosh Beginner
Joined: 20 Dec 2014 Posts: 44 Topics: 10
|
Posted: Thu Oct 16, 2025 11:38 pm Post subject: |
|
|
Just to add the job ended with JCL error because the data set HLQ.TEST was not found. Due to contention I couldn't create the data set Regards, Santosh _________________ Regards, Santosh |
|
| Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12397 Topics: 75 Location: San Jose
|
Posted: Fri Oct 17, 2025 11:00 pm Post subject: |
|
|
rsantosh,
Is your system part of sysplex ? If so you need to ensure that the dataset is NOT shared across systems. Assuming you have authorization for /D XCF command from SDSF and it will show you names. _________________ Kolusu
www.linkedin.com/in/kolusu |
|
| Back to top |
|
 |
rsantosh Beginner
Joined: 20 Dec 2014 Posts: 44 Topics: 10
|
Posted: Sat Oct 18, 2025 11:25 pm Post subject: |
|
|
Hello Kolusu, I checked, the LPAR is part of sysplex. How can I check if dataset is not shared across systems? If it is shared, will SHR not work the way it is supposed to work? _________________ Regards, Santosh |
|
| Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12397 Topics: 75 Location: San Jose
|
Posted: Mon Oct 20, 2025 11:00 pm Post subject: |
|
|
rsantosh,
If an LPAR is holding the dataset exclusively , then it means someone coded DISP=OLD or they creating the dataset and the task is still running. So you need to find out the job/task that is issuing the exclusive lock.
Search for the dataset name across the proclib/JCL libraries. _________________ Kolusu
www.linkedin.com/in/kolusu |
|
| Back to top |
|
 |
rsantosh Beginner
Joined: 20 Dec 2014 Posts: 44 Topics: 10
|
Posted: Tue Oct 21, 2025 2:23 am Post subject: |
|
|
Hello Kolusu, There is no other task/job holding the dataset I coded. I am not using any generic dataset name. For testing purpose I used my TSO ID only so that no one else can use it.
Instead of 3.2, I submitted below job in order and 2nd job showed the error message.
Job # 1 | Code: | //XYZ1 JOB
//STEP01 EXEC PGM=ZEKESET
//SYSIN DD*
SET WAIT 300
/*
//STEP02 EXEC PGM=IEFBR14
//DD01 DD DSN=XYZ.TEST,DISP=SHR | Job # 2 | Code: | //XYZ2 JOB
//STEP02 EXEC PGM=IEFBR14
//DD01 DD DSN=XYZ.TEST,DISP=(NEW,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=80),
// SPACE=(TRK,(1,1))
| | Code: | IEF861I FOLLOWING RESERVED DATA SET NAMES UNAVAILABLE TO XYZ2
IEF863I DSN=XYZ.TEST XYZ2 RC=04 RSN=00000000 FROM SERVICE ENQ | As soon as job 1 i.e XYZ1 failed with JCLERROR(XYZ.TEST DATASET NOT FOUND) the 2nd job XYZ2 completed successfully creating the dataset _________________ Regards, Santosh |
|
| Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12397 Topics: 75 Location: San Jose
|
Posted: Sat Oct 25, 2025 8:04 am Post subject: |
|
|
rsantosh,
Does the dataset already exist? If so looks like zeke is creating the EXCLUSIVE ENQ on the dataset even though it has DISP=SHR.
I am not sure wait 300 is in seconds or minutes. Assuming wait is in seconds and the job-1 is in a wait/suspended state for 5 mins , job-2 should be able to run and create the dataset. If it is NOT then you need to check if zeke is creating the exclusive locks _________________ Kolusu
www.linkedin.com/in/kolusu |
|
| Back to top |
|
 |
rsantosh Beginner
Joined: 20 Dec 2014 Posts: 44 Topics: 10
|
Posted: Sun Oct 26, 2025 4:50 am Post subject: |
|
|
| kolusu wrote: | rsantosh,
Does the dataset already exist? If so looks like zeke is creating the EXCLUSIVE ENQ on the dataset even though it has DISP=SHR.
I am not sure wait 300 is in seconds or minutes. Assuming wait is in seconds and the job-1 is in a wait/suspended state for 5 mins , job-2 should be able to run and create the dataset. If it is NOT then you need to check if zeke is creating the exclusive locks | Hello Kolusu,
The dataset doesn't exist. PGM=ZEKESET is STEP01 and it just suspends the process for 300 secs and this step doesn't have any dataset. Dataset XYZ.TEST is in STEP02 under PGM=IEFBR14. How would Zeke put a lock on dataset which is not mentioned in the step? While the job is in suspended state, JESYSMSG shows only following messages IEFA111I, IEf236I IEF237I and XYZ.TEST is not displayed which makes me believe that ZEKESET is not holding the dataset.
I wrote a simple COBOL program which calls CEE3DLY to suspend processing for 300 seconds and received the same dataset contention which I am receiving for ZEKESET. _________________ Regards, Santosh |
|
| Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12397 Topics: 75 Location: San Jose
|
Posted: Mon Oct 27, 2025 9:33 am Post subject: |
|
|
rsantosh,
Since the dataset does NOT exist, Job1 created an ENQ on the dataset name as soon as it starts executing, even thought the first step is a wait.
The 2nd job is in a wait state as it needs to create the dataset and update the catalog with the information. It is here that job2 will be waiting for the exclusive lock and hence the wait.
Once the wait is cleared, JOB1 will end with a JCL error as the dataset does NOT exist.
BTW what exactly are you trying to achieve here ? May be depending on the requirement, there might be an alternative. _________________ Kolusu
www.linkedin.com/in/kolusu |
|
| Back to top |
|
 |
|
|
|