View previous topic :: View next topic
|
Author |
Message |
Arun_scorpio
New User
Joined: 16 Oct 2009 Posts: 7 Location: India
|
|
|
|
Hi,
I am trying to retrieve the currently opened PDS in a rexx program from the member list panel. I tried using ISREDIT macro. But the return code was 20 after the first line. Then i tried using parse source. I got '?' as the output. I have pasted the code below. Please let me know if I am doing anything wrong in it. I am pretty new to rexx.
/******REXX******/
"ISREDIT MACRO"
"ISREDIT PDS=DATASET"
SAY PDS
PARSE SOURCE A B C D E
SAY E |
|
Back to top |
|
|
Arun_scorpio
New User
Joined: 16 Oct 2009 Posts: 7 Location: India
|
|
|
|
I want to add on to the previous post. I executed the code using the syntax
tso findpds from the command line of the member list panel. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
A few links to the appropriate structure for ISPF Macros:
Chapter 6. Creating Edit Macros:
Quote: |
Edit macros are ISPF dialogs that run in the ISPF editor environment.
CLIST edit macros must be in partitioned data sets in at least one of these concatenations: SYSUPROC, ALTLIB (for data sets activated as CLISTs), or SYSPROC. Data sets in these concatenations can contain CLIST edit macros, REXX edit macros, or a combination of both. However, REXX edit macros in these concatenations must include a REXX comment line (/* REXX */) as the first line of each edit macro to distinguish them from CLIST edit macros. This comment line can contain other words or characters if necessary, but it must include the string REXX.
REXX edit macros must also be in partitioned data sets. Besides the concatenations in the previous list for CLIST edit macros, REXX edit macros can exist in these concatenations: SYSUEXEC, ALTLIB (for data sets activated as EXECs), and SYSEXEC. Data sets in these concatenations can contain only REXX EXECs.
|
Running Program Macros:
Quote: |
The ISPF editor assumes that any unknown primary command is a macro, and it also assumes that the macro has been implemented as a CLIST or REXX exec.
If a macro named FINDIT is a CLIST or REXX exec macro, for example, you can run it by typing FINDIT on the command line and pressing Enter.
|
DATASET--Query the Current and Original Data Set Names:
Quote: |
The DATASET assignment statement retrieves these items and places them in selected variables:
The name of the data set into which the data currently being edited will be stored
The name of the data set from which the data currently being edited originated
The library concatenation number of the originating data set
| The path name of the file (when editing a z/OS UNIX file)
Syntax
__ISREDIT__(var1,var2,var3)__ = __DATASET
var1
The name of a variable to contain the name of the data set currently being edited. The data set name is fully qualified without quotation marks (').
| When editing a z/OS UNIX file, the path name of the file.
var2
The name of a variable to contain the name of the data set where the data currently being edited originated from. The data set name is fully qualified without quotation marks ('). If the data currently being edited is new, a blank is returned in this variable. If the original data is deleted, the name of the data set where the data currently being edited originated from is still returned in this variable.
var3
The library concatenation number of the original data set. If the data currently being edited is new, zeros are returned.
|
|
|
Back to top |
|
|
Arun_scorpio
New User
Joined: 16 Oct 2009 Posts: 7 Location: India
|
|
|
|
Hi Superk,
Thanks for the quick reply. I executed my rexx code during the edit session of a member by giving the program name as the command. I was able get the PDS name. But I want to retrieve the PDS name when i am in the member list panel (i.e after opening the PDS). For this, when i try to issue the same command , it says command not found error. does the edit macro work only during edit/view session of a member ? If yes, is there any other way I could get the PDS name from the member list panel. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Did you mean,"I want to pick up the current PDS name within the REXX you call from the command line"...if yes, check for ZSCREENI variable. |
|
Back to top |
|
|
Arun_scorpio
New User
Joined: 16 Oct 2009 Posts: 7 Location: India
|
|
|
|
Superk,
Thanks again. I finalyy found what I have been searching this forum for past few days. Variable 'ZDLDSN' has the currently opened dataset name.
Anuj,
I displayed the variable 'ZSCREENI'. It displayed the entire screen. It is not what I had wanted. But it may come in handy. Thanks for your reply. |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
ZDLxxxx variables are from option 3.4 data set list. Your solution will not work in other member lists like edit, browse, view, 3.1, etc. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Quote: |
I displayed the variable 'ZSCREENI'. ... It is not what I had wanted. |
I think it is the best method to get the name from a member list. It should work from 3.4, edit, browse, 3.14, etc... |
|
Back to top |
|
|
Arun_scorpio
New User
Joined: 16 Oct 2009 Posts: 7 Location: India
|
|
|
|
I agree. But I needed the PDS name only during the member list panel. So instead of parsing the zscreeni variable, I could directly use ZDLDSN variable. Both are very good options. But it is the case of selecting one which is best for your requirement. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
The only thing that I found using ZDLDSN was that when I access a dataset via an alias, it was the dataset alias which was displayed rather than the actual physical dataset name, where the physical dataset name was displayed using ZSCREENI. |
|
Back to top |
|
|
|