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

How to make a macro work in TSO environment


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

Active User


Joined: 06 Jul 2009
Posts: 213
Location: Chennai

PostPosted: Thu Sep 15, 2011 9:55 am
Reply with quote

I have a macro
Code:

/* EDIT MACRO */                                             
"ISREDIT MACRO"                                             
"ISREDIT (DataSet) = DATASET"                               
"ISREDIT (Member)  = MEMBER"                                 

DataSet="'"||DataSet||"'"                                   
IF Member = '' THEN                                         
   "ISREDIT replace .zf .zl "DataSet                         
ELSE                                                         
   "ISREDIT replace .zf .zl "Member


How do i make it work in TSO environment, i.e in the command line if i type 'vsave' this macro should be executed.

Regards,
Magesh
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Sep 15, 2011 10:16 am
Reply with quote

Do exactly as you describe. And why bother with such a macro? Using the SAVE command is quicker and more efficient.
Back to top
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 213
Location: Chennai

PostPosted: Thu Sep 15, 2011 10:31 am
Reply with quote

Incase if i open a file in view mode, i need to type repl .zf .zl filename to save it, I belive this code help me in doing this, i.e If i type VSAVE in command line,it should save it in view mode. But when i try using this VSAVE, it is not working i.e if i open a file in view mode, in the command line if i type VSAVE , it says invalid command. How do i make this VSAVE command valid. in other way VSAVE should save the file in view mode.

Regards,
Magesh
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Sep 15, 2011 10:46 am
Reply with quote

Quote:
it says invalid command.


your edit macro is not in a designated sysexec library.
also, could use the /*REXX*/ as first line. the comment that you have is really not necessary.

invoke isrddn to determine the library.
or listalc
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Sep 15, 2011 11:00 am
Reply with quote

and ispf edit macros run in ispf, not tso.
ispf runs in tso.

get you facts straight, and learn about and understand your environment.
Back to top
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 213
Location: Chennai

PostPosted: Thu Sep 15, 2011 11:02 am
Reply with quote

Thanks for kind respond,How do i get SYSEXEC library, where can i find it.

Could to please give me with syntax or an example
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Thu Sep 15, 2011 11:06 am
Reply with quote

yes, yes, yes, in VIEW mode you need to use the REPLACE command.

stop trying to sound so technically correct when you have no idea what is really going on.

serves you right for copying something you found
and thinking it is slick to use this,
without knowing enough about your environment to properly implement it.

and in reponse to your last question,
i gave you the answer. listalc or the isrddrn or however it is spelled.

this is your first edit macro, isn't it?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Sep 15, 2011 3:42 pm
Reply with quote

You can have the macro in your own PDS library as long as it is concatenated to SYSEXEC.
Back to top
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 213
Location: Chennai

PostPosted: Fri Sep 16, 2011 9:50 am
Reply with quote

Thanks to all the kind support, below program I executed in order make my macro work from the command line.
Code:

/* REXX */                                                           
ADDRESS TSO "ALLOCATE FI(SYSUPROC) DA('xxxx.xxxx.REXX5') SHR"     
ADDRESS TSO "ALTLIB ACTIVATE USER(CLIST)"                           



Regards,
Magesh
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Sep 16, 2011 11:19 am
Reply with quote

Good to hear this is working - thank you for posting your soluton icon_smile.gif

d
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 isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts trying to make sense of keylists TSO/ISPF 11
No new posts PRINTOUT macro PL/I & Assembler 0
No new posts Need COBOL COPY Help in MVS Environment COBOL Programming 4
No new posts create rexx edit Macro that edits the... CLIST & REXX 3
Search our Forums:

Back to Top