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

Extract PDS name from member list panel.


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Arun_scorpio

New User


Joined: 16 Oct 2009
Posts: 7
Location: India

PostPosted: Sat Oct 17, 2009 7:50 am
Reply with quote

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
View user's profile Send private message
Arun_scorpio

New User


Joined: 16 Oct 2009
Posts: 7
Location: India

PostPosted: Sat Oct 17, 2009 8:10 am
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Sat Oct 17, 2009 9:30 am
Reply with quote

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
View user's profile Send private message
Arun_scorpio

New User


Joined: 16 Oct 2009
Posts: 7
Location: India

PostPosted: Mon Oct 19, 2009 10:53 am
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Mon Oct 19, 2009 11:40 am
Reply with quote

Haven't we already been through this in this previous topic?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Oct 20, 2009 8:07 pm
Reply with quote

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
View user's profile Send private message
Arun_scorpio

New User


Joined: 16 Oct 2009
Posts: 7
Location: India

PostPosted: Wed Oct 21, 2009 12:53 pm
Reply with quote

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
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Wed Oct 21, 2009 6:32 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Wed Oct 21, 2009 8:57 pm
Reply with quote

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
View user's profile Send private message
Arun_scorpio

New User


Joined: 16 Oct 2009
Posts: 7
Location: India

PostPosted: Thu Oct 22, 2009 11:56 am
Reply with quote

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. icon_smile.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Oct 22, 2009 12:31 pm
Reply with quote

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
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 Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
No new posts How to create a list of SAR jobs with... CA Products 3
No new posts Call program, directly from panel CLIST & REXX 9
Search our Forums:

Back to Top