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

Dataset in use problem


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

New User


Joined: 01 Dec 2011
Posts: 2
Location: India

PostPosted: Fri Nov 02, 2012 1:14 pm
Reply with quote

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

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Nov 02, 2012 1:21 pm
Reply with quote

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

New User


Joined: 01 Dec 2011
Posts: 2
Location: India

PostPosted: Fri Nov 02, 2012 1:24 pm
Reply with quote

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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Nov 02, 2012 1:30 pm
Reply with quote

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

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Fri Nov 02, 2012 3:17 pm
Reply with quote

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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Nov 02, 2012 4:14 pm
Reply with quote

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
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 FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
Search our Forums:

Back to Top