IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Open Flat File status using REXX


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sridhar R

New User


Joined: 11 Dec 2010
Posts: 20
Location: India

PostPosted: Fri Sep 07, 2012 1:24 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Sep 07, 2012 1:45 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Fri Sep 07, 2012 9:15 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Running REXX through JOB CLIST & REXX 13
Search our Forums:

Back to Top