Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to get the name on currently opened dataset in REXX????

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: How to get the name on currently opened dataset in REXX????
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

Moderator Team Head


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

PostPosted: Tue Jul 31, 2007 6:14 pm    Post subject: Re: How to get the name on currently opened dataset in REXX?
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: 8619
Location: Back in jolly old England

PostPosted: Tue Jul 31, 2007 10:04 pm    Post subject:
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    Post subject:
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: 8619
Location: Back in jolly old England

PostPosted: Wed Aug 01, 2007 4:21 pm    Post subject:
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    Post subject:
Reply with quote

"ISREDIT (DSN) = DATASET"
say dsn

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

Moderator Team Head


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

PostPosted: Wed Aug 01, 2007 7:35 pm    Post subject: Re: How to get the name on currently opened dataset in REXX?
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    Post subject: Re: How to get the name on currently opened dataset in REXX?
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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: 6970
Location: porcelain throne

PostPosted: Thu Aug 02, 2007 2:22 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Looping REXX - unable to interrupt RAVISANKAR07 CLIST & REXX 3 Wed Dec 06, 2017 1:08 pm
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
This topic is locked: you cannot edit posts or make replies. Rexx to Grab ISMF Information. upendrasri All Other Mainframe Topics 16 Sun Nov 26, 2017 12:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us