Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to get the open PDS & MEMBER name in a macro

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
Srinivas46

New User


Joined: 03 Oct 2009
Posts: 4
Location: Chennai

PostPosted: Thu Dec 31, 2009 7:58 pm    Post subject: How to get the open PDS & MEMBER name in a macro
Reply with quote

My edit macro should fetch the Current PDS & Member name from which it is being executed.
Please let me know how to achieve this?

I was able to get the PDS name by the following code:
/* REXX */
/* BEGIN * /
PARSE SOURCE A B C D E
say "My current PDS name is: " E
/* END */

Now I want to fetch the member name.

Sri46
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu Dec 31, 2009 8:02 pm    Post subject: Reply to: How to get the open PDS & MEMBER name in a mac
Reply with quote

See this previous topic.

DATASET--Query the Current and Original Data Set Names.

MEMBER--Query the Current Member Name.

3.3 Chapter 11. Edit Macro Commands and Assignment Statements.
Back to top
View user's profile Send private message
Srinivas46

New User


Joined: 03 Oct 2009
Posts: 4
Location: Chennai

PostPosted: Sat Jan 02, 2010 11:48 am    Post subject: Reply to: How to get the open PDS & MEMBER name in a mac
Reply with quote

Thank you Kevin icon_biggrin.gif

It worked for me
Simplest one was:
/* REXX */
/* BEGIN * /
PARSE SOURCE A B C D E
say "My current PDS name is: " E
say "Member present is : " C
/* END */ [/i]
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Sun Jan 03, 2010 12:36 pm    Post subject:
Reply with quote

When executing an edit macro, it would be safer to use the ISREDIT commands as suggested by superk, since PARSE SOURCE returns different data in defferent situations.

O.
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 401
Location: Mumbai

PostPosted: Sun Jan 03, 2010 3:00 pm    Post subject: Reply to: How to get the open PDS & MEMBER name in a mac
Reply with quote

parse source and edit macro commands answer completely different questions. Parse source is the source of the macro itself. isredit commands are the data you are editing. Unless you are editing the macro itself, from the exact library you are running it from, these will always be different.

Parse source by itself (assuming you are looking for the macro location and NOT the data set you are editing), is not reliable in all situations. That is why the program that Kevin pointed to is needed for cases like the EXEC command, running from a temporary data set, and other cases.
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Sun Jan 03, 2010 8:44 pm    Post subject:
Reply with quote

Not to mention the fact that the code provided is NOT an edit "macro". If it was an edit "macro", it would include the statement required to identify itself as such. As the manual states:

All edit macros must have an ISREDIT MACRO statement as the first edit command.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts RC 20 for Address ISPEXEC "ISRED... pkmurali CLIST & REXX 3 Sun Apr 16, 2017 11:30 pm
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Browsing member from any PDS shiitiizz CLIST & REXX 7 Wed Mar 08, 2017 1:17 am
No new posts Bind plan as a member to another bind... rexx77 DB2 0 Thu Feb 16, 2017 2:02 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us