"ISREDIT RESET "
"ISREDIT RESET LABELS"
"ISREDIT FIND '(replace' FIRST 5"
If RC=0 then do
"ISREDIT (F#MODE ) = CURSOR"
"ISREDIT LABEL" F#MODE "= .LAAA "
"ISREDIT F ' ' .LAAA .LAAA FIRST "
X=F#MODE
X=X-1
"ISREDIT LABEL" X "= .X "
"ISREDIT F ' ' .X .X"
"ISREDIT C ', ' '' .X .X"
"ISREDIT X '(replace' first"
"ISREDIT DEL X ALL "
end
The find at label .LAAA works fine, rc=0
But the find at label .X fails rc=4 every time. I KNOW that there is
at least one blank on that line.
I tried doing Y=RIGHT(X,6,'0') to put leading zeros on the number
and using Y to create the Label. That works fine, but again, the find
commands fail whenever I try to use them. Anyone have any ideas ???
181 *-* "ISREDIT LABEL" Y "= .X "
>L> "ISREDIT LABEL"
>V> "000003"
>O> "ISREDIT LABEL 000003"
>L> "= .X "
>O> "ISREDIT LABEL 000003 = .X "
182 *-* "ISREDIT F 'D' .X .X"
>L> "ISREDIT F 'D' .X .X"
+++ RC(4) +++
183 *-* "ISREDIT C ', ' '' .X .X"
>L> "ISREDIT C ', ' '' .X .X"
----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX
I have to run so I don't have time to check your macro in detail but my
first guess would be it has something to do with the cursor position. You
found the word replace, and then you backed up one line to give the previous
line a label. However, just because you labelled the previous line doesn't
mean the cursor moved; in other words, the cursor is still BELOW the
labelled line. Therefore, when you issue a FIND command you are searching
from the current line forward (even though a label range was specified); in
other words you are searching for the NEXT occurence from the current cursor
position, as is the default when you issue a FIND command. To prove this,
check the return code from the FIND command and you should see that it's 4
and not 0. To fix this, try adding the word FIRST to the find command and I
think this will do what you want. If not let me know and I'll look into it
when I have a bit more time. HTH,
Dave Salt
http://www.soft-center.com
_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*.
http://join.msn.com/?page=features/virus
Also avoid using x as a variable.
If RC=0 then do
"ISREDIT (nLineCrs) = CURSOR"
"ISREDIT LABEL (nLineCrs) = .LAAA "
"ISREDIT F ' ' .LAAA .LAAA FIRST "
nLineAbv=nLineCrs-1
"ISREDIT LABEL (nLineAbv) = .X "
"ISREDIT F ' ' .X .X FIRST"
"ISREDIT C ', ' '' .X .X"
"ISREDIT X '(replace' first"
"ISREDIT DEL X ALL "
end
John Mattson
<John_Mattson@EA. To: TSO-...@VM.MARIST.EDU
EPSON.COM> cc:
Sent by: TSO REXX Subject: How to set a Label on the previous line
Discussion List
<TSO-...@VM.MARI
ST.EDU>
05/07/2003 06:09
PM
Please respond to
TSO REXX
Discussion List
> I have to run so I don't have time to check your macro in detail but my
> first guess would be it has something to do with the cursor position.
I think that's probably right. My recollection is that when I did
something like you're doing I used the "ISREDIT CURSOR" command to move
the cursor to the position I wanted it to be in before issuing the next
find command. I can't remember exactly, but I think you can put it
nominally just befor the first character of a line, say the n'th line,
with:
"ISREDIT CURSOR" n 0
Or before the start of the file with "ISREDIT CURSOR 0 0". Also, it's
odd to use:
"ISREDIT (F#MODE ) = CURSOR"
"ISREDIT LABEL" F#MODE "= .LAAA "
"ISREDIT F ' ' .LAAA .LAAA FIRST "
because ispf already has a label set wherever the cursor is. You don't
need to ask ispf where the cursor is, then set a label there, because
ZCSR is there already. The three lines could simply be:
"ISREDIT F ' ' .ZCSR .ZCSR FIRST"
Then to do the arithmetic I'd have done:
"ISREDIT (where) = LINENUM .ZCSR"
where = where - 1
which admittedly adds back in some of the stuff I just took out.
You can also make the code much easier to read by mising the "ISREDIT"
off each line. Instead of:
"ISREDIT blah"
"ISREDIT blah"
"ISREDIT blah"
you can code:
address ISREDIT
"blah"
"blah"
"blah"
Note though, if you do this you need to take care about what other
address environments other statements will be sent to - ie if there are
plain TSO or ISPEXEC commands, that they get the right environment.
--
Jeremy C B Nicoll - my opinions are my own.