I am attempting to perform a series of regex's on a series of text values.
My thought is to maintain a dataset of regex's to apply to may dataset of text values.
data work.transforms;
infile datalines;
input regex $;
datalines;
s/æ/ae/
s/ ltd / limited /
s/ corp / corporation /
;
run;
proc transpose data=work.transforms out=work.transline;
run;
The resulting dataset has no rows. I was expecting a single row with a column for each regex.
What is going on? Can I do a transpose on a character field?
(In case it is relevant: my intention is to join my transline
and names
datasets together and then use a loop to transform each name.)
If you don't tell PROC TRANSPOSE which variables to transpose it only transposes the numeric variables. You have to use the VAR statement to tell PROC TRANSPOSE which variables you want it to transpose to have it include character variables.
proc transpose data=work.transforms out=work.transline;
var regex;
run;