View previous topic :: View next topic
|
Author |
Message |
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Hi Guyz,
I tried out an sample program from ISPF Edit Macros manual, following is the macro
Code: |
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"
"ISREDIT MACRO (HEADER)"
SET &COUNT = 1
DO WHILE &COUNT <= 9
ISREDIT FIND 'TEST - #'
SET &RETCODE = &LASTCC
IF &RETCODE = 0 THEN
DO
ISREDIT CHANGE '#' '&COUNT'
SET &COUNT = &COUNT + 1
END
ELSE
SET &COUNT = 10
END
EXIT |
I get the following error
Code: |
6 +++ ISREDIT MACRO SET &COUNT = 1
Error running TEST1, line 6: Logical value not 0 or 1
*** |
This is due to &COUNT. It is consider it as an Logical AND.
But this is how its given in the manual.
Where am i making the mistake, can i know ?
Sushanth |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
stop using clist and use rexx. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I agree, although the code was working fine for me. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Great Start,
So, What are the things i need to change to convert it into rexx ?
Sushanth |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Guyz,
I hope, i have converted my program to rexx
Code: |
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"
"ISREDIT MACRO (HEADER)"
'ISREDIT COUNT = 1'
DO WHILE COUNT <= 9
'ISREDIT F "TEST - #"'
'ISREDIT RETCODE = LASTCC'
IF RETCODE = 0 THEN
DO
'ISREDIT CHANGE "#" "&COUNT"'
'ISREDIT COUNT = COUNT + 1'
END
ELSE
'ISREDIT COUNT = 10'
END
EXIT |
Now, iam getting lots of this
Code: |
COMMAND RETCODE NOT FOUND
COMMAND COUNT NOT FOUND
COMMAND RETCODE NOT FOUND
COMMAND COUNT NOT FOUND
COMMAND RETCODE NOT FOUND
COMMAND COUNT NOT FOUND
COMMAND RETCODE NOT FOUND
COMMAND COUNT NOT FOUND
COMMAND RETCODE NOT FOUND |
Sushanth |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Not tested
Just changed by eye, so you might get an error or two
Code: |
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"
"ISREDIT MACRO (HEADER)"
COUNT = 1
DO WHILE COUNT <= 9
'ISREDIT F "TEST - #"'
RETCODE = RC
IF RETCODE = 0 THEN
DO
'ISREDIT CHANGE "#" "COUNT"'
COUNT = COUNT + 1
END
ELSE
COUNT = 10
END
EXIT
|
|
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Expat,
Just changed yours from "COUNT" to "'count'".
Works Great.
I did something like this
Code: |
/*REXX****************************************/
/* EDIT MACRO - TESTING **********************/
/*********************************************/
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"
"ISREDIT MACRO (HEADER)"
COUNT = 1
DO WHILE COUNT <= 9
'ISREDIT F "TEST - #"'
'ISREDIT CHANGE "#" "&COUNT"'
COUNT = COUNT + 1
END
EXIT |
In my code, i removed the returncode. Because, i didn't know what variable is used for return code. Thank You EXPAT, for telling me exactly that RC
Sushanth |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
sushanth bobby, where did you find that example? I could not find it in the book. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Pedro,
ISPF Edit and Edit Macros
z/OS Version 1 Release 7.0
SC34-4820-04
Fifth Edition (September 2005)
Simplifying Complex Tasks - Page 87
Sushanth |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Quote: |
I tried out an sample program from ISPF Edit Macros manual,
...
I get the following error |
I looked at the manual... you did not faithfully copy it. Do not blame the manual if you change the example. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I had a feeling ... |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
OK. I am a bad copier.
Sushanth |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
I did not intend to highlight your sloppiness *
I mentioned it because I (and several others) spend a great deal of time looking at the forum questions. I prioritize my time based on the topic and how interesting a puzzle it would be for me.
If you had used this subject line instead: "Error in the way I copied the sample program", I might have handled it differently.
* actually, I did. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Yes, Pedro.
Next time, i'll do that.
Thanks,
Sushanth |
|
Back to top |
|
|
|