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 

How to get PDS name from which REXX is executed

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


Joined: 26 Jun 2003
Posts: 5
Topics: 2

PostPosted: Sun Sep 21, 2003 3:39 am    Post subject: How to get PDS name from which REXX is executed Reply with quote

Hi All,

I want to get the PDS from which rexx is being executed. This pds name will be used for some other purpose down the line in the program. How do I do it?

Please suggest a solution ASAP
TIA
Askids
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Sun Sep 21, 2003 10:17 am    Post subject: Reply with quote

askids,

Try this

Code:

/*rexx */                     
address isredit
" macro"               
"(ds) = dataset"       
"(mem) = member"
Say 'The pds being execueted is 'ds' and the member is ' mem
Back to top
View user's profile Send private message Send e-mail Visit poster's website
askids
Beginner


Joined: 26 Jun 2003
Posts: 5
Topics: 2

PostPosted: Mon Sep 22, 2003 11:05 am    Post subject: Reply with quote

I am not looking for this. I am trying to get the pds name where this REXX program is stored. Say for ex: I have the REXX program in my userid.REXX.EXEC. I want to get this name in the program. How do I get this?

Sorry...If I was not clear with my question before.

TIA
Askids
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Mon Sep 22, 2003 1:41 pm    Post subject: Reply with quote

Askids,
I assume that you are searching for a member in a pds, but you do not know the name of the pds.Here is a sample rexx code written by Doug nadel which will give you the name of the PDS.You need to supply the High-level qualifier along with the member name.

Save this proc as a member or a dataset.To execute this type the following command at your command prompt.

Code:

EXEC 'USERID.REXX.EXEC(findmem)' 'USERID MEMBER' exec



Code:

Parse Upper Arg hlq member
Address ispexec
if member='' then do;say 'Parameter(s) missing.';exit;end
"CONTROL ERRORS RETURN"
"CONTROL REFLIST NOUPDATE"
"LMDINIT LISTID(LISTID) LEVEL("hlq")"
dlistrc=rc
dsn=""
Do While dlistrc=0
  "LMDLIST LISTID(&LISTID) OPTION(LIST) STATS(YES) DATASET(DSN)"
  dlistrc=rc
  If zdldsorg="PO" Then
    Do
      "LMINIT DATAID(INDID) DATASET('"dsn"') ENQ(SHR)"
      If rc=0 Then
        Do
          "LMOPEN DATAID(&INDID) OPTION(INPUT)"
          If rc=0 Then
            Do
              "LMMFIND DATAID(&INDID) MEMBER("member")"
              If rc=0 Then
                Say member' - 'dsn
            End
          "LMFREE DATAID(&INDID)"
        End
    End
End
"LMDFREE LISTID(&LISTID)"                 
"CONTROL REFLIST UPDATE"



Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Tue Sep 23, 2003 1:00 am    Post subject: Reply with quote

Kolusu,
Im not sure, if the REXX shown by you will meet askids requirement.
Say, you have a rexx like this in your dataset concatenated to sysproc/sysexec.
Code:


/* rexx - spn */
say 'This is just for testing"



Now when this code is executed from the command shell, he would say
tso test(*assume test is the name of the member in which this rexx is written*). Now the code, shown by you would display all the PDS'es that contain the member test and you also need to pass your "your user id " and "test" as parameters.

I guess the solution would be something along these lines:

> Find all the datasets concatenated to SYSPROC/SYSEXEC.
> Parse the command itself inside your REXX and find out the member name. (TEST in this case)
> Search for the member name in the datasets.

Correct me If Iam wrong?

Cheers,
Coolman.
________
weed vaporizer


Last edited by coolman on Sat Feb 05, 2011 1:29 am; edited 1 time in total
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Tue Sep 23, 2003 2:32 am    Post subject: Reply with quote

How r you going to execite this rexx, maybe, 'TSO EX ....'. In this case it should be easier to retreive the last command and find dsn from there. How to do this I don't know. Sorry Embarassed
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu Sep 25, 2003 3:21 am    Post subject: Reply with quote

coolman,

As my post clearly states that I assumed that he wanted to scan for a pds member and the rexx exec gives you that. But that may not be the case, as intrepreted by you. so lets wait for askids clarification

Thanks

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
askids
Beginner


Joined: 26 Jun 2003
Posts: 5
Topics: 2

PostPosted: Thu Sep 25, 2003 7:23 am    Post subject: Reply with quote

Hi All,
Thanks for all the suggestion. I found a code that meets my need. Here is the link to it. http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&newwindow=1&selm=rsl1as89tvmtn8c38u8u5etj7if6ie9kq7%404ax.com.

This is from google groups archives.

Closing this post.
Thanks once again
Askids
Back to top
View user's profile Send private message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Thu Sep 25, 2003 3:13 pm    Post subject: Reply with quote

Two of the best authors around.

Well searched.
_________________
The day you stop learning the dinosaur becomes extinct
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