Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Init macro or not ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1228
Location: Israel

PostPosted: Wed Jan 11, 2012 4:28 pm    Post subject: Init macro or not ?
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: 1018
Location: Oostende, Belgium

PostPosted: Wed Jan 11, 2012 5:08 pm    Post subject:
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: 1228
Location: Israel

PostPosted: Wed Jan 11, 2012 6:12 pm    Post subject: Reply to: Init macro or not ?
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: 1018
Location: Oostende, Belgium

PostPosted: Wed Jan 11, 2012 6:19 pm    Post subject:
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: 1228
Location: Israel

PostPosted: Wed Jan 11, 2012 6:36 pm    Post subject:
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    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 RC 20 for Address ISPEXEC "ISRED... pkmurali CLIST & REXX 3 Sun Apr 16, 2017 11:30 pm
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Released Init 0 Yolanda Harvey All Other Mainframe Topics 13 Thu Aug 11, 2016 8:51 pm
No new posts PCOMM macro to call another PCOMM macro boyti ko All Other Mainframe Topics 4 Tue Jul 12, 2016 4:30 pm
No new posts Send parameter for macro STIMERM from... Daniel Teolotitla PL/I & Assembler 13 Tue Jul 05, 2016 9:23 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us