IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Thu Dec 31, 2009 8:02 pm
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
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: 2358
Location: Israel

PostPosted: Sun Jan 03, 2010 12:36 pm
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: 400
Location: Mumbai

PostPosted: Sun Jan 03, 2010 3:00 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Calling an Open C library function in... CICS 1
No new posts PRINTOUT macro PL/I & Assembler 0
No new posts Open VSAM File in IMS DC Region - DFS... IMS DB/DC 0
No new posts How to copy the -1 version of a membe... TSO/ISPF 4
No new posts Searching for a member but don't know... TSO/ISPF 6
Search our Forums:

Back to Top