View previous topic :: View next topic
|
Author |
Message |
dubasir
New User
Joined: 05 Jun 2006 Posts: 19
|
|
|
|
Hi,
I am calling an edit macro from rexx using below statement
"EDIT DATASET('dataset name') MACRO(macro name)"
In the macro, i have given "NUMBER OFF" "LEFT MAX" commands
The macro is failing with below error.
command in error: LEFT MAX
Initial macro error
The macro command entered is not allowed from an initial macro.
Error message id: ISRE310
Last retrun code : 20
Can you please tell me what exactly the error is?
Thanks,
Suresh. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
You have trouble reading? The system told you what the problem is.
From the ISPF Edit and Edit Macros manual:
Quote: |
LEFT does not change the cursor position and cannot be used in an initial macro. |
|
|
Back to top |
|
|
dubasir
New User
Joined: 05 Jun 2006 Posts: 19
|
|
|
|
Hi,
But i am not trying to change the cursor position here using this command.
I just wanted to start the code from 1st column in case it is in NUM STD COB mode (the code starts from 7 th column).
I have used the LEFT MAX command in another macro which is working properly. But this macro is throwing the error.
I did not understand why it is acting differently for two macros.
Thanks,
Suresh. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Quote: |
Can you please tell me what exactly the error is?
|
How can anybody tell you exactly what the error is, when you have not shown exaclty what the macro looks like? A snippet of the calling Rexx program would help as well.
Quote: |
I have used the LEFT MAX command in another macro which is working properly. But this macro is throwing the error.
I did not understand why it is acting differently for two macros.
|
There is obviously something different about the macros, or the way they are being called. Nobody here can help you because you have shown us NOTHING. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
From the ISPF Edit and Edit Macros manual:
Quote:
LEFT does not change the cursor position and cannot be used in an initial macro.
just in case you have trouble reading.
use the cursor command to position the cursor.
use bounds/profile/.... command to determine num profile and
adjust your code accordingly. |
|
Back to top |
|
|
dubasir
New User
Joined: 05 Jun 2006 Posts: 19
|
|
|
|
calling program:
DSNME = PDSNME||"("||MEM.K||")"
MEM1 = MEM.K
ADDRESS ISPEXEC
"VPUT (OSTR NSTR EXCOMT WORD MEM1) PROFILE"
"EDIT DATASET('"DSNME"') MACRO(STRMACRO)"
and the called program goes this way:
TRACE I
ADDRESS ISREDIT
"MACRO"
ADDRESS ISPEXEC "VGET (OSTR NSTR EXCOMT WORD MEM1) PROFILE"
ADDRESS ISREDIT
"(STAT,VALUE) = NUMBER"
"NUMBER OFF"
"LEFT MAX"
"FIND '//' 1 ALL"
FIND_RC = RC
IF FIND_RC = 0 THEN
DO ........
Thanks,
Suresh |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
what about
cannot be used in an initial macro
do you not understand? |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Quote: |
I have used the LEFT MAX command in another macro which is working properly. But this macro is throwing the error.
I did not understand why it is acting differently for two macros.
|
My guess would be is that the 'other' macro is invoked directly from the command line, while this macro is as an INITIAL macro from an ISPEXEC EDIT command. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Dick,
I just noticed you are located on the throne created by my ancestors. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
A little more of an explanation:
"Remember that commands referencing display values (DISPLAY_COLS, DISPLAY_LINES, DOWN, LEFT, RIGHT, UP, LOCATE) are invalid in an initial macro because no data has been displayed." |
|
Back to top |
|
|
dubasir
New User
Joined: 05 Jun 2006 Posts: 19
|
|
|
|
Yes, the other macro directly called one. Honestly, I was not sure the term initial macro. But, now I got it and the Left command cannot be used in macro which called from ISPEXEC EDIT.
But, How can we shift the code left maximum in this case.
Thanks,
Suresh. |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
Quote: |
But, How can we shift the code left maximum in this case.
|
Why do you need to shift the code?
You are doing a find all anyway.
You have already deceided what you 'think' you need to do, and are stuck on finding a solution.
As Enrico would say "meditate" on what you really need. |
|
Back to top |
|
|
dubasir
New User
Joined: 05 Jun 2006 Posts: 19
|
|
|
|
Yeah, I don't need to shift the code, I was just confused. Now, The code is working fine without the LEFT command.
I am new to this macro things, but i want to learn it. So, I might asked you the basic questions.
anyways thanks a lot for your responses.
Regards,
Suresh. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I am new to this macro things, but i want to learn it. |
Someone is usually here when there are questions. . .
Suggest you read about the "thing" and if you have a doubt, post what you found and your doubt. Someone will probably be able to clarify. |
|
Back to top |
|
|
|