Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How can the rexx being executed get the name of its rexxlib?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: How can the rexx being executed get the name of its rexxlib?
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

Site Director


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

PostPosted: Wed Jun 06, 2007 5:16 am    Post subject:
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

Moderator Team Head


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

PostPosted: Wed Jun 06, 2007 9:18 am    Post subject: Re: How can the rexx being executed get the name of its rexx
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: 2360
Location: Israel

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

Try PARSE SOURCE.

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

Moderator Team Head


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

PostPosted: Wed Jun 06, 2007 11:43 pm    Post subject: Re: How can the rexx being executed get the name of its rexx
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    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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 47 Fri Sep 29, 2017 1:08 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us