View previous topic :: View next topic |
Author |
Message |
Sreejith Intermediate
Joined: 02 Dec 2002 Posts: 155 Topics: 25 Location: N.Ireland
|
Posted: Mon Dec 02, 2002 8:44 am Post subject: To find the dataset where a particular member is located |
|
|
To find the dataset where a particular member is located
This one I got from somebody.
Code: |
/* Rexx find which data sets in a dslist contain a member */
/* Syntax: Tso findmem pattern */
/* where pattern is a name or pattern with % And * Characters */
/* requires ISPF 4.5+ */
/* ** Uses some undocumented or unsupported methods *** */
Parse Upper Arg pattern .
If pattern="" Then /* Insure parm was passed */
Do
Say "No member pattern specified"
Exit
End
dta = ptr(76+ptr(ptr(24+ptr(112+ptr(132+ptr(540))))))
tname=storage(d2x(dta+196),8) /* Get dslist table name */
If substr(tname,1,3)="DSL" & "NUM"=datatype(delstr(tname,1,3)) Then
Do
Address ispexec
"CONTROL ERRORS RETURN" /* Trap errors */
"TBTOP "tname /* Move to top of table */
"TBSKIP "tname /* Go to 1st row */
Do While rc=0 /* Loop through rows */
zudxstat="Y" /* Exclude the line */
If zudvol \= "MIGRAT" & substr(zudvol,1,1)\= "*" Then
Do /* If online real dataset */
"LMINIT DATAID(MS) DATASET('&ZUDSNS') ENQ(SHR) ORG(DSO)"
If rc=0 Then /* Allocated? */
Do
If dso="PO" Then /* Known pds or pdse */
Do
check="" /* Init for LMMLIST */
"LMOPEN DATAID(&MS) OPTION(INPUT)" /* Open the ds */
If rc=0 Then /* Open OK? */
If pos("*",pattern)>0 | pos("%",pattern)>0 Then
"LMMLIST DATAID(&MS) MEMBER(CHECK) ",
"PATTERN(&PATTERN) OPTION(LIST)"
Else
"LMMFIND DATAID(&MS) MEMBER(&PATTERN) "
If rc=0 Then /* If found */
Do
zudxstat="N" /* Unexclude list */
zulmsg="07"x||"FOUND: "pattern /* Set message */
End
End
"LMFREE DATAID(&MS)" /* Free the allocation */
End
End
"TBPUT "tname /* Update the table */
"TBSKIP "tname /* Move to next row */
End
"CONTROL NONDISPL ENTER" /* Force refresh */
End
Else
Say " The data set list table could not be found "
Return
ptr:Return c2d(storage(d2x(Arg(1)),4))
|
|
|
Back to top |
|
|
raj051076 Beginner
Joined: 05 Dec 2002 Posts: 64 Topics: 21
|
Posted: Tue Dec 10, 2002 11:06 pm Post subject: |
|
|
what does it do actually..what is this table name that it is returning..in which isptlib is this table residing _________________ Rajib |
|
Back to top |
|
|
Sreejith Intermediate
Joined: 02 Dec 2002 Posts: 155 Topics: 25 Location: N.Ireland
|
Posted: Wed Dec 11, 2002 4:56 am Post subject: |
|
|
Raj
I am not an expert on RExx but I use this every day to locate cobol programs. In my shop there is no version control and a program can be in any one's personnel PDS. So I got to 3.4 and list all HLQ.userid.* and say TSO FINDMEM pgmname and this will list only those datasets where the pgmnane member is located.I named the rexx as FINDMEM and put it in SYSEXEC.
May be some REXX experts can answer the second part of your question
Sreejith |
|
Back to top |
|
|
Bill Dennis Advanced
Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
|
Posted: Wed Dec 11, 2002 9:13 am Post subject: |
|
|
I love this stuff! Thanks for sharing.
Bill |
|
Back to top |
|
|
ak Beginner
Joined: 04 Dec 2002 Posts: 4 Topics: 0 Location: New York, USA
|
Posted: Wed Dec 11, 2002 10:17 am Post subject: |
|
|
This one is from Doug Nadel's site.
http://www.sillysot.com/mvs/
If you are on the Z/OS, this command comes in-built in the O/S in the name of MEMBER. Also this exec can take wildcards (LMMFIND can) such as * and %.
As to what it returns is the internal ISPF table that contains the dataset list. DSL####. That will have a struct of fields :
ZUDSNS
ZUSIZE
ZUUS
ZUCDATE
ZUEDATE
ZURDATE
ZUDVOL
ZUDMVOL
ZUDEVICE
ZUCDAT2
ZUEDAT2
ZURDAT2
ZUORG
ZUX
ZURECFM
ZULRECL
ZUBLKSIZ
ZUSTAT
ZUDSPACU
ZULMSG
ZULOCVOL
ZUOBTATT
ZUOBTSPC
ZUOBTDAT
ZUDXSTAT
ZULCMDL
ZUD20V
All useful Z-vars. HTH. |
|
Back to top |
|
|
Ranjish Beginner
Joined: 22 Dec 2002 Posts: 64 Topics: 28 Location: Chennai
|
Posted: Sun Dec 22, 2002 1:35 am Post subject: |
|
|
Hi Sreejith,
I tried this TSO FINDMEM. But it is giving S0C1 abend everytime.
Any idea on this?
Ranjish. |
|
Back to top |
|
|
|
|