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: 6966
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: 7251

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: 1746
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: 10210
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 SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm


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