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

Init macro or not ?


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

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Jan 11, 2012 4:28 pm
Reply with quote

My macro can be run in two ways:
From the command line:
Code:
Command ===> MYMACRO

From a REXX program:
Code:
"VIEW DATASET("ds") MACRO(MYMACRO)"


In the first case, everything work fine,
in the second case I receive message ISRE310:
Code:
COMMAND IN ERROR . : UP MAX                                   
                                                               
Initial macro error                                           
The macro command entered is not allowed from an initial macro.


One way to fix this is to pass a "hidden" parameter in my REXX program:
no parameter: command line, parameter found: initial macro.

Another way would be for the macro to ask "do I run as an initial macro?"
However I haven't found any Edit Macro statement that answers that (IMACRO tells me NONE in both cases)
Did I miss it ?
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1314
Location: Vilnius, Lithuania

PostPosted: Wed Jan 11, 2012 5:08 pm
Reply with quote

In what context do you issue the "UP MAX"? Wouldn't it be possible to replace it by a "locate .zf"?
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Jan 11, 2012 6:12 pm
Reply with quote

The macro adds a few notelines at the top of the file with "LINE_BEFORE .ZF = NOTELINE (MyNote)"
Doing LOCATE .ZF places me on line 1 and the notelines are hidden.

Another way to solve my little problem would be to do UP MAX only if cursor line is not 1.
(funnily, it doesn't help if line 1 is actually the cursor line...)
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1314
Location: Vilnius, Lithuania

PostPosted: Wed Jan 11, 2012 6:19 pm
Reply with quote

And what about a "locate 0"? In normal edit it does work, right now I cannot test it from a macro.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Jan 11, 2012 6:36 pm
Reply with quote

"LOCATE 0" works in both cases.
Thanks Robert! Good thinking!
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 SDUMPX macro fails to dump requested ... PL/I & Assembler 5
No new posts How can I add/create a new INIT(initi... TSO/ISPF 2
No new posts Access to macro definitions PL/I & Assembler 4
No new posts PRINTOUT macro PL/I & Assembler 0
No new posts create rexx edit Macro that edits the... CLIST & REXX 3
Search our Forums:

Back to Top