0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

SASテクニック フォルダ作成

Last updated at Posted at 2020-07-12

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の名前も分ける

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?