Eric, we were able to come up with an example to do what he wanted here by-passing the regular expressions. Hopefully, this did not expose anything else by doing so.
proc template;
define tagset tagsets.test;
parent=tagsets.excelxp;
define event value_type;
set $format "General";
set $value strip(VALUE);
do /if $value;
do / if !tagattr;
eval $is_numeric prxmatch($number,$value);
do /if $is_numeric;
set $type "Number";
set $value compress($value,$punctuation);
do /if index(value, %nrstr("%%")) > 0;
set $format "Percent" /if index(value, %nrstr("%%")) > 0;
eval $tmp inputn($value,$test_format) / 100;
set $value $tmp;
else /if index(value, $currency) > 0;
set $format $currency_format /if index(value, $currency) > 0;
done;
done;
else;
set $type "String";
done;
done;
do /if $attrs["type"];
set $type $attrs["type" ];
else /if ^cmp( $type, "Number");
set $type "String";
do /if $is_numeric;
set $type "Number" /if cmp( type, "int");
set $type "Number" /if cmp( type, "double");
set $type "String" /if cmp( type, "string");
done;
done;
end;
end;
run;
data one;
x='100%';
y=20000;
z=3.3;
run;
ods tagsets.test file="temp.xls";
proc print data=one;
var x / style={tagattr="format:@"};
var y / style={tagattr="format:###,###"};
var z ;
run;
ods tagsets.test close;