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

How can the rexx being executed get the name of its rexxlib?


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

New User


Joined: 30 May 2007
Posts: 1
Location: Luxembourg

PostPosted: Wed Jun 06, 2007 4:52 am
Reply with quote

Hello,
My Rexx command will be stored (of course) into one of the pds that are allocated in TSO/ISPF to SYSPROC.

I want my REXX to get the name of the particular PDS that it comes from.
I couldn't find a system variable giving it. Is there a service or a command to get this info ?

if someone could give me a clue.. It would be great.
Fran?ois
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jun 06, 2007 5:16 am
Reply with quote

Hello and welcome to the forums,

You might look into ISRDDN - which will find which library(ies) a specified member is in. I'm not sure if this can be invoked via REXX. . .

I've always used if via command line (TSO ISRDDN) which brings up a menu and selections are made from there. I recall being able to include parameter data with the command, but it has been long enough that i don't recall the specifics.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Jun 06, 2007 9:18 am
Reply with quote

I did some searching because I know I've seen this question before. I found the topic on some other sites, but none that offered a valid suggestion other than chasing after system control blocks.

The only thing I can think of is to find all of the datasets that are allocated to SYSPROC, then find the one(s) that contains the member name that is being executed. Unfortunately, this method wouldn't be able to account for the same member being present in multiple PDS's.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Jun 06, 2007 10:58 am
Reply with quote

Try PARSE SOURCE.

O.
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Wed Jun 06, 2007 11:43 pm
Reply with quote

Something like this, perhaps?

Code:

/* REXX */                                           
Parse Source . . execname ddname .                   
Parse Value "" With dsnstr ln. start. end. ddn. ml. 
Parse Value "0 0 0 0" With ddnx ddn# dsnx  .         
                                                     
x = Outtrap("ln.")                                   
"LISTA STATUS"                                       
x = Outtrap("Off")                                   
                                                     
                                               
Do trapx = 1 To ln.0                           
  If Left(ln.trapx,1) <> "" Then Iterate       
  If Substr(ln.trapx,3,1) <> " " Then           
    Do                                         
      ddn#       = ddn# + 1                     
      ddn.ddn#   = Word(ln.trapx,1)             
      start.ddn# = trapx - 1                   
      end.ddn#   = trapx - 1                   
    End                                         
  Else If Left(ln.trapx,1) = " " Then           
    Do                                         
      end.ddn#   = trapx - 1                   
    End                                         
End                                             

Do ddnx = 1 To ddn#                                             
  If Wordpos(ddn.ddnx,ddname) > 0 | ddname = "" Then             
    Do dsnx = start.ddnx To end.ddnx By 2                       
      dsnstr = dsnstr ln.dsnx                                   
      x = Outtrap("ml.")                                         
      "LISTDS '"ln.dsnx"' MEMBERS"                               
      x = Outtrap("Off")                                         
      Do n = 7 To ml.0                                           
        ml.n = Space(ml.n,0)                                     
        If execname = ml.n Then Say execname "is in '"ln.dsnx"'"
      End                                                       
    End                                                         
End                                                             
Exit 0                                                           
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 Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
Search our Forums:

Back to Top