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

How to get the name on currently opened dataset in REXX????


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

New User


Joined: 23 Apr 2007
Posts: 26
Location: India

PostPosted: Tue Jul 31, 2007 5:46 pm
Reply with quote

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

Global Moderator


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

PostPosted: Tue Jul 31, 2007 6:14 pm
Reply with quote

Since the SEARCH function appears to not be working:

3.3.21 DATASET--Query the Current and Original Data Set Names.

3.3.53 MEMBER--Query the Current Member Name.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Jul 31, 2007 10:04 pm
Reply with quote

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

New User


Joined: 23 Apr 2007
Posts: 26
Location: India

PostPosted: Wed Aug 01, 2007 12:53 pm
Reply with quote

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

Global Moderator


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

PostPosted: Wed Aug 01, 2007 4:21 pm
Reply with quote

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

New User


Joined: 23 Apr 2007
Posts: 26
Location: India

PostPosted: Wed Aug 01, 2007 6:16 pm
Reply with quote

"ISREDIT (DSN) = DATASET"
say dsn

it doesnt show anything
Back to top
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Wed Aug 01, 2007 7:35 pm
Reply with quote

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

New User


Joined: 23 Apr 2007
Posts: 26
Location: India

PostPosted: Thu Aug 02, 2007 9:31 am
Reply with quote

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

New User


Joined: 01 Jun 2005
Posts: 17
Location: USA

PostPosted: Thu Aug 02, 2007 10:51 am
Reply with quote

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

New User


Joined: 23 Apr 2007
Posts: 26
Location: India

PostPosted: Thu Aug 02, 2007 11:48 am
Reply with quote

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

New User


Joined: 23 Apr 2007
Posts: 26
Location: India

PostPosted: Thu Aug 02, 2007 11:49 am
Reply with quote

GETDSN is the name of the REXX program
Back to top
View user's profile Send private message
angt

New User


Joined: 01 Jun 2005
Posts: 17
Location: USA

PostPosted: Thu Aug 02, 2007 11:51 am
Reply with quote

No need of TSO

just use GETDSN it will work.
Back to top
View user's profile Send private message
hermit_reloaded

New User


Joined: 23 Apr 2007
Posts: 26
Location: India

PostPosted: Thu Aug 02, 2007 11:59 am
Reply with quote

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

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Aug 02, 2007 2:22 pm
Reply with quote

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
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 Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top