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

Edit Macro is not being executed


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

New User


Joined: 28 Feb 2007
Posts: 1
Location: United States

PostPosted: Fri Dec 28, 2012 8:42 pm
Reply with quote

I am new in REXX. I wrote a simple edit macro but enable to execute the editmaro statements.
Code:
/*REXX*/
SAY 'HELLO'
TRACE R
ADDRESS ISPEXEC
"ISREDIT MACRO () NOPROCESS"
"ISREDIT RESET EXCLUDED"
"ISREDIT EXCLUDE ALL '-' 1"
"ISREDIT FIND FIRST '-' 1"
"ISREDIT DELETE ALL EXCLUDED"
EXIT

The 'HELLO' is being displayed but after ADDRESS ISPEXEC statement, all the statements are giving rc 20.

Can anybody help me to correct the code?
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Fri Dec 28, 2012 8:52 pm
Reply with quote

The 'HELLO' is being displayed because what you have coded is a REXX exec, not an edit MACRO. The rc=20 is happening for the other lines because REXX does not understand them.

In your REXX, you need to invoke edit for a dataset e.g.


Code:
 ADDRESS ISPEXEC "EDIT DATASET('"dsn"")') MACRO("macname ")"   


and have the MACRO coded separately in a library available to the REXX exec e.g.

Code:
ADDRESS ISPEXEC
"ISREDIT MACRO () NOPROCESS"
"ISREDIT RESET EXCLUDED"
"ISREDIT EXCLUDE ALL '-' 1"
"ISREDIT FIND FIRST '-' 1"
"ISREDIT DELETE ALL EXCLUDED"
"ISREDIT SAVE"


Garry.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Dec 28, 2012 8:52 pm
Reply with quote

search the forums for examples
if You search using My userid as additional argument You will find quite a bit of examples

here is a direct link, to a working example,
but probably it is a bit too complicated for a beginner
www.ibmmainframes.com/viewtopic.php?t=25947&highlight=

and here is a link to the TSO and ISPF bookshelves

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/Shelves/IKJ4BK90

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/Shelves/ISPZPM70

not the latest ones but more than enough for Your current needs

up to You to search for the manuals related to Your zOS level
starting from
www-03.ibm.com/systems/z/os/zos/bkserv/index.html

and here is a very old but very useful manual with well explained examples

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ISRVPB01/CONTENTS?SHELF=&DT=19931028105440

but then You might also search the IBM redbooks for additional info and techniques
Back to top
View user's profile Send private message
Michael Jakob

New User


Joined: 13 Mar 2011
Posts: 17
Location: Switzerland

PostPosted: Tue Jan 01, 2013 1:08 pm
Reply with quote

Hello arnab3472

Runs your edit macro in a proper edit session? How did you call your edit-macro? "COMMAND ===> TSO hello" will not work.

Is there any reason you need noprocess?

I rather would specify "ISREDIT MACRO " without parenthesis and noprocess.

An edit-macro should be ended by "ISREDIT MEND"

At last an edit-macro should return an reasonable returncode. (EXIT)
0: all fine - cursor stayes at last position.
1: fine - but the cursor is placed at the command field.
other: signal an problem in edit macro.

The manual "ISPF Edit and Edit Macros" mentioned above is a fine and usable manual.
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 RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts PRINTOUT macro PL/I & Assembler 0
No new posts Need help to resolve a hard edit COBOL Programming 8
Search our Forums:

Back to Top