解決しました。脚注を参照してください。
/*check regex*/
go = 1;
i = 1;
do while (go = 1);
set braw.regex point = i;
if (upcase(fname) = upcase("&var.")) then do;
put format1 " one"; /*format1 is a field of braw.regex, properties says character length 30*/
if format1 = '/\d{8}/' then put 'hello world one'; else put 'good bye world one';
%check1(&data, format1, &var)
end;
else i = i+1;
end;
/*check1 passes regex, string, true false to check_format*/
%macro check_format(regex, string, truefalse);
pattern = prxparse(®ex.);
truefalse = prxmatch(pattern, &string);
put ®ex " " &string " " &truefalse "post";
%mend;
インデントがないことをお詫びします-スタックオーバーフローはバグがあるようです。
この出力
/\d{8}/ one
good bye world one
どうやらフォーマットは文字列ではありません。したがって、文字列入力を探しているため、prxparseは失敗します。私が何をしているのか考えていますか?
マクロ変数を使用して引用符で囲むことができると考えていました。おそらく次のように使用します。
call symput('mymacrovar', format1);
%let mymacrovar = "&mymacrovar";
しかし、そのシンプットは何もしません。
解決済み: 文字列として読み取られていました。正規表現データセットが読み取られていたCSVファイルでは、コンマの間に追加のスペースがあり、prxparseが気に入らない文字列'/ \ d{8}/'を作成していました。