$S- -- Synonym translation OFF ONERROR GOLABEL /ERROR0 !CurrentCE = !!CE -- -- Collect all elbows that have SR somewhere in the name of the spre -- var !Elbows collect all elbo with matchw(NAME OF SPRE, '*SR*') for $!!CE if !Elbows.size() gt 0 then -- -- If there is at least one SR elbow found attempt to change it -- do !Elbow values !Elbows -- -- Go to ELBO in list and capture its SPRE name -- $!Elbow !OldSpre = !!CE.SPRE.NAME -- -- Take everything before SR in old spre name, then LR, then everything -- after SR and concatenate them together into new spre name. -- !NewSpre = !OldSpre.before('SR') & 'LR' & !OldSpre.after('SR') -- -- Attempt to change the SPRE name. If the SPCO does not exist, -- error out. If it does exist, report success. -- SPRE $!NewSpre handle (2,109) $P -- $P SPCO $!NewSpre does not exist! $P SPRE will not be changed for $!!CE.FULLNAME ! $P -- elsehandle NONE $P Changed SPRE for $!!CE.FULLNAME to $!NewSpre ... endhandle enddo $P $P Done! $P -- -- Return use to initial CE -- $!CurrentCE else -- -- If there are no SR elbows found tell them so. -- $P -- $P There are no SR elbows under $!!CE.FULLNAME $P -- endif -- -- Switch synonyms back on if an error occurs. -- LABEL /ERROR0 handle ANY $!CurrentCE $S+ RETURN ERROR endhandle $S+ -- Synonym translation ON