Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 4650
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
This topic is locked: you cannot edit posts or make replies. ISREDIT Macro is not returning back t... nico_neoz CLIST & REXX 21 Sat Nov 18, 2017 7:40 pm
No new posts -502 Error - Cursor already open anand jeyapaul DB2 7 Sun Oct 29, 2017 4:22 am
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts exec macro in the end of edit anatol CLIST & REXX 8 Fri Sep 22, 2017 5:10 am
No new posts Reply MQ open error Vignesh Sid COBOL Programming 6 Thu Sep 07, 2017 6:02 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us