View previous topic :: View next topic
|
Author |
Message |
Srinivas46
New User
Joined: 03 Oct 2009 Posts: 4 Location: Chennai
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
Srinivas46
New User
Joined: 03 Oct 2009 Posts: 4 Location: Chennai
|
|
|
|
Thank you Kevin
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
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 |
|
|
Ronald Burr
Active User
Joined: 22 Oct 2009 Posts: 293 Location: U.S.A.
|
|
|
|
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 |
|
|
|