Skip to main content

proc exportステートメント

サンプル

proc export data=sashelp.class outfile='C:\SAS_Study\class.csv' dbms=csv replace;
run;
proc export data=sashelp.class outfile='C:\SAS_Study\class.xlsx' dbms=xlsx replace;
    sheet = class;
run;

オブション

proc exportから;までの間にスペース区切りで記述する。

オプション 指定する内容 説明
data= データセット名 出力対象のデータセットを指定
outfile= ファイルパス
or ファイル参照名
「出力先ファイルのフルパス」または「filenameステートメントで定義したファイル参照名」を指定
dbms= データソース名 外部ファイルのデータの種類を指定
xlsx / csv / tab / dlm(delimiterステートメントと併用)
replace - 出力データセットを上書きする場合は指定

プロシジャ内ステートメント

proc export ~;からrun;までの行に記述する。

ステートメント 指定する内容 説明
putnames= yes / no 列名情報をファイルに書き出すかどうかを指定(デフォルトはyes)
sheet= Excelシート名 読み込むシート名を指定(dbms=xlsxの場合のみ有効)