Page 1 of 1

A macro edit change doesn't work

PostPosted: Thu Mar 10, 2011 3:15 pm
by samb01
Hello,

this my rexx


  "ISPEXEC VGET (PREFIXB PREFIXC)"                         
 ADDRESS ISREDIT;                                           
 "MACRO";                                                   
 "CURSOR = .ZFIRST 1";                                     
 PREFIX1 = '&ALIAS$$'                                       
 PREFIX2 = 'UVAL'PREFIXC'.'PREFIXB''                       
 "SCAN OFF"                                                 
 "CHANGE '"PREFIX1"' ''"PREFIX2"'' ALL"                     
 "END"                                                     




and i have the fllowing message


>O>   "CHANGE '&ALIAS$$"                           
>L>   "' "                                         
>O>   "CHANGE '&ALIAS$$' "                         
>V>   "UVAL"                                       
>O>   "CHANGE '&ALIAS$$' UVAL"                     
>L>   ""                                           
>O>   "CHANGE '&ALIAS$$' UVAL"                     
>V>   "CO"                                         
>O>   "CHANGE '&ALIAS$$' UVALCO"                   
>L>   "."                                           
>O>   "CHANGE '&ALIAS$$' UVALCO."                   
>V>   "COPSEQ"                                     
>O>   "CHANGE '&ALIAS$$' UVALCO.COPSEQ"             
>L>   " ALL"                                       
>O>   "CHANGE '&ALIAS$$' UVALCO.COPSEQ ALL"         
+++ RC(28) +++                                     
*-* "END"                                           
>L>   "END"                                         
+++ RC(28) +++



Thanks for your help

Re: A macro edit change doesn't work

PostPosted: Thu Mar 10, 2011 3:22 pm
by NicC
So what does a return code of 28 for the CHNGE command say?

Re: A macro edit change doesn't work

PostPosted: Thu Mar 10, 2011 5:21 pm
by prino
I guess, but cannot verify this now, that the problem is the '&' in your change string.

Try changing

"isredit c '"from"' '"to"' all"

into

fromh = c2x(from)
toh   = c2x(to)
"isredit c x'"fromh"' x'"toh"' all"

Re: A macro edit change doesn't work

PostPosted: Thu Mar 10, 2011 7:09 pm
by samb01
Thank you prino, ti works now. :D