View previous topic :: View next topic
|
Author |
Message |
Lesage Francois
New User
Joined: 30 May 2007 Posts: 1 Location: Luxembourg
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Try PARSE SOURCE.
O. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
|