SASでフォルダ作成
普通に作ればいいんだけど...
フォルダがある前提でプログラム動かしてて、フォルダなくてエラー出るとうざい
以下、フォルダ作成マクロ
%macro Folder_Make(Pass = ., Folder = %str());
%if &Folder. = %str() %then %do;
%put ERROR: 作成フォルダ名ちゃんと指定しろや;
%goto tobu;
%end;
%if %sysfunc( fileexist( "&Pass." ) ) = 0 %then %do;
%put ERROR: パスちゃんと指定しろや;
%goto tobu2;
%end;
%if %sysfunc( fileexist( "&Pass.\&Folder." ) ) = 0 %then %do;
%let rc = %sysfunc( dcreate( &Folder. , &Pass. ) );
%end;
%tobu:
%tobu2:
%mend;
tobu2はtobuでも問題ない
飛ぶ先を分ける場合はgotoの名前も分ける