MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

To find the dataset where a particular member is located

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
Sreejith
Intermediate


Joined: 02 Dec 2002
Posts: 155
Topics: 25
Location: N.Ireland

PostPosted: Mon Dec 02, 2002 8:44 am    Post subject: To find the dataset where a particular member is located Reply with quote

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
View user's profile Send private message Send e-mail Yahoo Messenger
raj051076
Beginner


Joined: 05 Dec 2002
Posts: 64
Topics: 21

PostPosted: Tue Dec 10, 2002 11:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sreejith
Intermediate


Joined: 02 Dec 2002
Posts: 155
Topics: 25
Location: N.Ireland

PostPosted: Wed Dec 11, 2002 4:56 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Yahoo Messenger
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Wed Dec 11, 2002 9:13 am    Post subject: Reply with quote

I love this stuff! Thanks for sharing.

Bill
Back to top
View user's profile Send private message
ak
Beginner


Joined: 04 Dec 2002
Posts: 4
Topics: 0
Location: New York, USA

PostPosted: Wed Dec 11, 2002 10:17 am    Post subject: Reply with quote

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
View user's profile Send private message
Ranjish
Beginner


Joined: 22 Dec 2002
Posts: 64
Topics: 28
Location: Chennai

PostPosted: Sun Dec 22, 2002 1:35 am    Post subject: Reply with quote

Hi Sreejith,

I tried this TSO FINDMEM. But it is giving S0C1 abend everytime.
Any idea on this?

Ranjish.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group