Hi All,
I have the below dataset, need to replace the values in target variable with Replace variable. Its working fine with tranwrd , but i am unable to do using PRXCHANGE and PRX parse as i am missing how to PARSE the Target variable values in PRXPARSE
| Source |
target |
replace |
Output |
| Vegetables are apples and oranges |
vegetables |
Fruits |
Fruits are apples and oranges |
| Sugars are Fruct and Fructose |
fruct |
GLUC |
Sugars are GLUC and Fructose |
| Labtest and Labtestcd are same |
Labtestcd |
Lab.Labtestcd |
Labtest and lab.labtestcd are same |
data aa;
set abc;
new=tranwrd(source,target,replacement) ;
neew = PrxChange('s/\b(Vegetables)\b/Fruits/i' , -1 , strip(source));;
run ;
In the above example i am replacing fruits with vegetables, but i am having huge dataset and i have to replace all the target variable with replace variable. Target variable can consists of combination of letters , numbers and special characters , but i have to replace them with replace variable. How do i parse the TARGET variable values to use them in PRXCHANGE .
Any sample code with little explanation on how to use PRXPARSE and PRXCHANGE replace in dataset. Individually it can be done , but with different combinations its causing issue.