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 

Current PDS access in REXX

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


Joined: 07 Apr 2004
Posts: 46
Topics: 29

PostPosted: Tue Apr 27, 2004 11:28 pm    Post subject: Current PDS access in REXX Reply with quote

Hi,
How to access a PDS from rexx program. i.e. If I execute rexx exec, it has to access the current pds and members. Please help me how to do this?



Thanks
sai krishna
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Apr 27, 2004 11:51 pm    Post subject: Reply with quote

kris_madras,

Code:

/*rexx */                     
address isredit
" macro"               
"(ds) = dataset"       
Say 'The pds being execueted is 'ds'


This gives you the name of the dataset from where the rexx exec is being execueted. Once you have the name then you can use the examples shown in this topic to process the current PDS

http://www.mvsforums.com/helpboards/viewtopic.php?t=256&highlight=members

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kris_madras
Beginner


Joined: 07 Apr 2004
Posts: 46
Topics: 29

PostPosted: Wed Apr 28, 2004 12:03 am    Post subject: Reply with quote

Hi,

Lot of thanks for your reply. Could you please help me by correcting the code

its displaying THE PDS BEING EXECUETED IS DS.


Thanks and Regards,
Sai Krishna
Back to top
View user's profile Send private message
Maton_Man
Beginner


Joined: 30 Jan 2004
Posts: 123
Topics: 0

PostPosted: Wed Apr 28, 2004 1:43 am    Post subject: Reply with quote

Too many quotes...take the last one off the last line of the code.

/*rexx */
address isredit
" macro"
"(ds) = dataset"
Say 'The pds being executed is 'ds
_________________
My opinions are exactly that.
Back to top
View user's profile Send private message
Mike
Beginner


Joined: 03 Dec 2002
Posts: 114
Topics: 0
Location: Sydney, Australia

PostPosted: Wed Apr 28, 2004 5:17 pm    Post subject: Reply with quote

The problem could be that you are not invoking the edit Macro correctly.

To use an edit macro you must be within the ISPF editor (or view but not browse). You issue the command, i.e. the member name where the Rexx is located (assumes that the Rexx is allocated to either SYSEXEC or SYSPROC) without prefixing it with TSO (space after TSO).

e.g. assuming that your Rexx is saved in the member FINDDS, then you should enter FINDDS on the command line within edit. If you enter the command TSO FINDDS then you will get the result that you have found.

I would advise using the TRACE command within the Rexx (I use TRACE I to start tracing and TRACE O to terminate the trace).

Here's two examples that use TRACE, one is when the Rexx is invoked incorrectly (note the RC(20) from the MACRO command i.e. a severe error because you aren't in EDIT, also note another error when you issue the DATASET EM command, again RC(20) because of the same reason). The second is the trace from when the edit macro is invoked correctly).

1)
3 *-* address isredit
4 *-* " macro"
>L> " macro"
+++ RC(20) +++
5 *-* "(ds) = dataset"
>L> "(ds) = dataset"
+++ RC(20) +++
6 *-* Say 'The pds being execueted is 'ds
>L> "The pds being execueted is "
>L> "DS"
>O> "The pds being execueted is DS"
The pds being execueted is DS
7 *-* Trace O

2)
3 *-* address isredit
4 *-* " macro"
>L> " macro"
5 *-* "(ds) = dataset"
>L> "(ds) = dataset"
6 *-* Say 'The pds being execueted is 'ds
>L> "The pds being execueted is "
>V> "DMI021.USER.EXEC"
>O> "The pds being execueted is DMI021.USER.EXEC"
The pds being execueted is DMI021.USER.EXEC
7 *-* Trace O
_________________
Regards,
Mike.
Back to top
View user's profile Send private message
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Thu Apr 29, 2004 9:12 am    Post subject: Reply with quote

Ravi,

You have to be in edit mode within the member of the PDS where you want to run the macro, not within the macro itself...Basically you have to allocate the macro library to sysproc and then open the member on which you want to run the macro and then simple give the macro name on the command line. That should run the macro.

Regards,
Manas
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Maton_Man
Beginner


Joined: 30 Jan 2004
Posts: 123
Topics: 0

PostPosted: Thu Apr 29, 2004 10:12 pm    Post subject: Reply with quote

Without going into a lengthy explanation and summarising the text of the respective manuals....

The reason for the difference is that edit macros are invoked by the editor using the ISPF SELECT service. If you prefix them with TSO then they get invoked as a TSO command.

If you append your edit macro with % it will limit the search to the SYSPROC and SYSEXEC concatenation to speed things up. You can also prefix with ! if you write your macros in COBOL or some other compiled language and only ISPLLIB, STEPLIB, and LINKLST load libraries will be searched.
_________________
My opinions are exactly that.
Back to top
View user's profile Send private message
Maton_Man
Beginner


Joined: 30 Jan 2004
Posts: 123
Topics: 0

PostPosted: Thu Apr 29, 2004 10:17 pm    Post subject: Reply with quote

I should have said 'prefix' not 'append'...
_________________
My opinions are exactly that.
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