View previous topic :: View next topic |
Author |
Message |
askids Beginner
Joined: 26 Jun 2003 Posts: 5 Topics: 2
|
Posted: Sun Sep 21, 2003 3:39 am Post subject: How to get PDS name from which REXX is executed |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Sun Sep 21, 2003 10:17 am Post subject: |
|
|
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 |
|
|
askids Beginner
Joined: 26 Jun 2003 Posts: 5 Topics: 2
|
Posted: Mon Sep 22, 2003 11:05 am Post subject: |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Mon Sep 22, 2003 1:41 pm Post subject: |
|
|
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 |
|
|
coolman Intermediate
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
|
Posted: Tue Sep 23, 2003 1:00 am Post subject: |
|
|
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 |
|
|
Dibakar Advanced
Joined: 02 Dec 2002 Posts: 700 Topics: 63 Location: USA
|
Posted: Tue Sep 23, 2003 2:32 am Post subject: |
|
|
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 |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Thu Sep 25, 2003 3:21 am Post subject: |
|
|
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 |
|
|
askids Beginner
Joined: 26 Jun 2003 Posts: 5 Topics: 2
|
|
Back to top |
|
|
Mervyn Moderator
Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
|
Posted: Thu Sep 25, 2003 3:13 pm Post subject: |
|
|
Two of the best authors around.
Well searched. _________________ The day you stop learning the dinosaur becomes extinct |
|
Back to top |
|
|
|
|