View previous topic :: View next topic
|
Author |
Message |
hermit_reloaded
New User
Joined: 23 Apr 2007 Posts: 26 Location: India
|
|
|
|
Hi All,
I am making a mainframe tool in REXX. This tool requires that i get the name of a opened dataset (PDS and member both). This tool will be executed inside of a dataset. Therefore i wanted to ask is there any way to get the name of the currently opened dataset into a rexx variable.
Does MVS stores the names of the dataset opened in side a system variable. For e.g SYSUID stores the current user logged in. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Not to mention what else you might find in the REXX Reference manual.
A link for which I have put as a sticky in this very forum.
Take a look at (I think) LISTDSI with the FILE parameter. |
|
Back to top |
|
|
hermit_reloaded
New User
Joined: 23 Apr 2007 Posts: 26 Location: India
|
|
|
|
well i used that and when i try to print the name of the dataset it doesnt show anything.
Kindly tell he how to display the name of the dataset after getting it with the above method |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Quote: |
well i used that and when i try to print the name of the dataset it doesnt show anything. |
What did you try ? |
|
Back to top |
|
|
hermit_reloaded
New User
Joined: 23 Apr 2007 Posts: 26 Location: India
|
|
|
|
"ISREDIT (DSN) = DATASET"
say dsn
it doesnt show anything |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Here's my macro:
Code: |
/* REXX */
TRACE I
"ISREDIT MACRO"
"ISREDIT (DSN) = DATASET"
SAY DSN
|
Here's my runtime results:
Code: |
3 *-* "ISREDIT MACRO"
>L> "ISREDIT MACRO"
4 *-* "ISREDIT (DSN) = DATASET"
>L> "ISREDIT (DSN) = DATASET"
5 *-* SAY DSN
>V> "SUPERK.REXX"
SUPERK.REXX
***
|
|
|
Back to top |
|
|
hermit_reloaded
New User
Joined: 23 Apr 2007 Posts: 26 Location: India
|
|
|
|
My code
Code: |
/*REXX*/
ADDRESS ISPEXEC
TRACE I
"ISREDIT MACRO"
"ISREDIT (DSN) = DATASET"
SAY DSN
|
Code: |
4 *-* "ISREDIT MACRO"
>L> "ISREDIT MACRO"
+++ RC(20) +++
5 *-* "ISREDIT (DSN) = DATASET"
>L> "ISREDIT (DSN) = DATASET"
+++ RC(20) +++
6 *-* SAY DSN
>L> "DSN"
DSN
***
|
Kindly tell me why i am not getting the same results... |
|
Back to top |
|
|
angt
New User
Joined: 01 Jun 2005 Posts: 17 Location: USA
|
|
|
|
Hermit ,
I do not see any thing wrong. Probably you are not executing it correctly. I tried it and it worked perfectly.
as it is a ISREDIT MACRO it will work only when you will run it while viewing or editing a dataset. you need to execute this like you issue a find or change command |
|
Back to top |
|
|
hermit_reloaded
New User
Joined: 23 Apr 2007 Posts: 26 Location: India
|
|
|
|
I tried as shown below but still getting the same answer
have opened the dataset in edit mode.
Code: |
Command ===> tso getdsn
****** ***************************** Top of Data ************
000001 /*REXX*/
000002 TRACE I
000003 "ISREDIT MACRO"
000004 "ISREDIT (DSN) = DATASET"
000005 SAY DSN
|
|
|
Back to top |
|
|
hermit_reloaded
New User
Joined: 23 Apr 2007 Posts: 26 Location: India
|
|
|
|
GETDSN is the name of the REXX program |
|
Back to top |
|
|
angt
New User
Joined: 01 Jun 2005 Posts: 17 Location: USA
|
|
|
|
No need of TSO
just use GETDSN it will work. |
|
Back to top |
|
|
hermit_reloaded
New User
Joined: 23 Apr 2007 Posts: 26 Location: India
|
|
|
|
thanx man its working now.....
but can you please tell me as to why it wasnt working before when i used TSO GETDSN.....
I am pretty clueless |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
when you are EDITing/VIEWing a DS, you are within an ISPF application space. When you enter the name of a ISPF recognizable command/macro on the command line (or invoke thru a dedicated PF-Key) the command/macro will execute within the ISPF application space you are in (i.e. edit/view window).
an example: sub(mit) will act upon the member you are editing viewing. If you type TSO SUB, the command will be executed within a new application space - which is why you will be prompted for a DS/PDS(Mem) name.
so, when invoking an edit macro with <TSO #name>, even though you were in an EDIT/VIEW panel, the TSO part will invoke a new application and then invoke the command. Since you are in a new application - pure tso - and not an ISPF EDIT/VIEW 'sub-application', the macro attempts to run, accessing zvariables which are not set.
a few sites to visit Doug Nadel's website , Lionel Dyck's website and Schlabb's website each of whom has a collection of excellent articles and ready made REXX'S & CLISTS. Over the years, all have contributed to the MVS community. Also, each website has links to other websites which are of the same caliber. Schlabb's website has copies of out-of-print articles written by Jim Moore about ispf and tso, which I would suggest to anybody read. |
|
Back to top |
|
|
|