View previous topic :: View next topic
|
Author |
Message |
Josh Keller
New User
Joined: 08 Oct 2007 Posts: 36 Location: Columbia, SC
|
|
|
|
I'm writting an edit macro in rexx to replace several strings in JCL. When the macro attempts to find a JCL symbolic &CYCID for example, it's interpreting the string as a embedded pattern, so the string is not found.
Question: How can the edit macro change a string if it contains a "&" ?
Example:
STR = "&CYCID"
"ISREDIT FIND '"STR"' NEXT"
This expample returns an error reporting that STR is null.
My backup plan is to scan through the JCL and use the POS command to find the strings in question. But this has got me thinking if there is a way to do it using the ISREDIT commands.
Thanks,
Josh |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
dealing with &, I usually start my macro by changing all & to :.
, if I know that there will be no colons <:>. or some other char.
changing to an x'??' means that you can not use the 1st char unless it is a printable.
if I am only looking for one char, then I will use the x'??' format (for example x'ff').
in your case you are looking for &?????, so make it ???? or #?????, by a CHG ALL '&'' ':'. Then at the end of your macro, change all : to &. |
|
Back to top |
|
|
Josh Keller
New User
Joined: 08 Oct 2007 Posts: 36 Location: Columbia, SC
|
|
|
|
I didn't think about hex... so your post gave me an idea.
I used the C2X function and converted my strings to hex, then did a FIND X"'"HEXSTR"'" It worked like a champ.
Thanks,
Josh |
|
Back to top |
|
|
|