View previous topic :: View next topic
|
Author |
Message |
Arry_J
New User
Joined: 01 Dec 2011 Posts: 2 Location: India
|
|
|
|
I am trying to use the above given commands.
I am not getting the desired results.
With CALL OUTTRAP, i am getting no result:-
LIST="'ABCD'"
SAY 'DDOUT1:' LIST
CALL OUTTRAP "LIST."
"LISTA STATUS" |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Pedro wrote: |
If you are editing and get 'dataset in use', you can press PF1 (twice) and it will show you who also has that dataset. |
|
|
Back to top |
|
|
Arry_J
New User
Joined: 01 Dec 2011 Posts: 2 Location: India
|
|
|
|
So i have coded some thing wrong. The Please help to correct it.
I want the same result as per the forum to know if Dataset is in use... |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Please don't tailgate an old topic. Start a new topic, referring to the original with a link (see the URL button?) if needed. |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
Arry_J wrote: |
I want the same result as per the forum to know if Dataset is in use... |
Offhand I can't think of a way to do that through pure Rexx; however, have you looked into the ISPF QUERYENQ service? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
why not a bovine ALLOC.... with DISP OLD
it WILL give a RC 12 if the file is in use
here is the snippet used to test it
save it somewhere and execute if from two different users
the parse pull will ensure that the ENQ is held long enough
Code: |
****** ***************************** Top of Data ******************************
000001 /*REXX */
000002 Trace "O"
000003 aparm = "OLD"
000004 dsname = "'<somedsname>'"
000005 a_rc = $alloc("DDNAME", dsname, aparm)
000006 say a_rc
000007 say "enter to continue"
000008 parse pull z
000009 exit
000010 end
000011 Exit 0
000012
000013 /* */
000014 $tsoex:
000015 tso_0tr = trace("O")
000016 Address TSO arg(1)
000017 tso_0rc = rc
000018 trace value(tso_0tr)
000019 return tso_0rc
000020 /* */
000021 $alloc:procedure
000022 alc_0tr = trace("O")
000023 parse upper arg ddnm, dsnm, misc
000024 ddnm = strip(ddnm)
000025 dsnm = strip(dsnm)
000026 dsnm = strip(dsnm,,"'")
000027 dsnm = "DA('"dsnm"') "
000028 misc = space(misc)
000029 alc_0ms = msg("OFF")
000030 Address TSO "FREE FI("ddnm") "
000031 Address TSO "ALLOC FI("ddnm") " dsnm misc
000032 z = msg(alc_0ms)
000033 alc_0rc = rc
000034 trace value(alc_0tr)
000035 Return alc_0rc
****** **************************** Bottom of Data ****************************
|
|
|
Back to top |
|
|
|