On 2015-08-31 15:21, J O Skip Robinson wrote:
> Gil right about the difficulty of determining opened vs. allocated, but maybe 
> that does not matter. As for Rexx, being a simple minded person, I would 
> issue the OS command
> 
>   D GRS,C 
> 
> and parse the output returned to the Rexx. You can see whether the data set 
> is 'in use' on another system. I hope that all sharing systems are in a 
> single GRS-plex...
> 
... Which still leaves the timing window.  That tells you only whether
the DSN *was* in use when the Display command was issued.  I'd prefer:

user@OS/390.24.00: rexx "trace R; \
>      DSN = foo.bar; \
>      say BPXWDYN( 'alloc rtddn(D) dsn('DSN') new delete msg(2)' ); \
>      say 'Do whatever is needed with' DSN 'and' D'.'; \
>      say BPXWDYN( 'free    dd('D')                      msg(2)' ); \
> "
     1 *-*  DSN = foo.bar
       >>>    "FOO.BAR"
       *-*  say BPXWDYN( 'alloc rtddn(D) dsn('DSN') new delete msg(2)' )
       >>>    "0"
0
       *-*  say 'Do whatever is needed with' DSN 'and' D'.'
       >>>    "Do whatever is needed with FOO.BAR and SYS00001."
Do whatever is needed with FOO.BAR and SYS00001.
       *-*  say BPXWDYN( 'free    dd('D')                      msg(2)' )
       >>>    "0"
0
... The ENQ EXC guarantees that the DSN is not in use for the duration.

-- gil

> .
> .
> .
> J.O.Skip Robinson
> Southern California Edison Company
> Electric Dragon Team Paddler 
> SHARE MVS Program Co-Manager
> 626-302-7535 Office
> 323-715-0595 Mobile
> [email protected]
> 
> -----Original Message-----
> From: IBM Mainframe Discussion List [mailto:[email protected]] On 
> Behalf Of Lizette Koehler
> Sent: Monday, August 31, 2015 2:05 PM
> To: [email protected]
> Subject: Re: Dataset in use on shared DASD
> 
> If you were not aware, there is a list dedicated to all things REXX To join, 
> if you have not done so, you can do the following
> 
> http://www2.marist.edu/htbin/wlvindex?tso-rexx
> go to the bottom of the webpage
> 
> Lizette
> 
> 
> -----Original Message-----
>> From: George Shedlock <[email protected]>
>> Sent: Aug 31, 2015 1:37 PM
>> To: [email protected]
>> Subject: Dataset in use on shared DASD
>>
>> How can I tell from a REXX program if a dataset is open on another LPAR? The 
>> dataset resides on shared dasd.
>>
>> George Shedlock
> 
> 
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
> 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to