Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Dataset in use problem

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Reply to: How to find the dataset status "Data set in u
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: 6967
Location: porcelain throne

PostPosted: Fri Nov 02, 2012 1:21 pm    Post subject: Re: Reply to: How to find the dataset status "Data set
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Fri Nov 02, 2012 1:30 pm    Post subject: Reply to: Dataset in use problem
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: 1755
Location: Bloomington, IL

PostPosted: Fri Nov 02, 2012 3:17 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Fri Nov 02, 2012 4:14 pm    Post subject: Reply to: Dataset in use problem
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts LISTCAT on a dataset with symbolic pa... shreya19 JCL & VSAM 5 Fri Apr 07, 2017 5:43 pm
No new posts Strings with double quotes having pro... raja Arumugam All Other Mainframe Topics 11 Thu Mar 30, 2017 10:34 am
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us