View previous topic :: View next topic
|
Author |
Message |
Sridhar R
New User
Joined: 11 Dec 2010 Posts: 20 Location: India
|
|
|
|
I have a flat file which i'm reading in my REXX code. Here before opening that file I want to check whether that the same file is using by some other resource(user). Could anyone help me??
For Eample :
I have file name called 'TEST.SMS.FILE'
user_list = 'TEST.SMS.FILE'
"ALLOC DA('"user_list"') F(ulist) OLD"
queue 'xxxxxxxxxxx'
queue 'yyyyyyyyyyy'
"EXECIO "QUEUED()" DISKW ulist (FINIS"
But before I'm into this file I want to check whether the same file is using by any user/resource. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
in IT terminology and consistency are essential for effective communication
You describe Your <requirement> as READ,
but then Your code shows a write.
review Your understanding of dataset disposition both for JCL-DD and ALLOC
using OLD will automatically let You have the dataset under exclusive control |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Quote: |
I want to check whether that the same file is using by some other resource(user) |
Depending on your skill, use either
1. the QUERYENQ service of ISPF. The QNAME is SYSDSN and the RNAME is your fully qualified dataset name.
or
2. use the GQSCAN macro. See "MVS Assembler Services Guide" |
|
Back to top |
|
|
|