- EXIST関数・・・「SASデータセット」の存在確認をする。
- FILEEXIST関数・・・「外部ファイル」の存在確認をする。
- 存在する場合「1」、存在しない場合「0」が返される。
例
| data test; x = exist( "sashelp.class" ); y = fileexist( "c:\test/test.xlsx" ); run; ![]() |
記事の内容うっすい・・
| data test; x = exist( "sashelp.class" ); y = fileexist( "c:\test/test.xlsx" ); run; ![]() |
| リターンコードを格納する変数 = FILEEXIST( "確認したいフォルダまたはファイルのフルパス" ); |
data _null_; length msg $2000.; rc = fileexist("D:\myfolder\test.txt"); if rc^=1 then do; msg=sysmsg(); put msg; end; run; |