これは完全な回答ではありませんが、開始されます。ファイルを取得したい別のディレクトリを通過するために外部ループを追加する必要があります。
/*List the files in a directory for use in a data step. This is written for Windows. Other operating systems will be slightly different. */
filename fnames pipe 'dir c:\temp\* /b';
/* Create a data set with one observation for each file name */
data fnames;
infile fnames pad missover;
input @1 filename $255.;
n=_n_;
run;
/* Store the number of files in a macro variable "num" */
proc sql noprint; select count(filename) into :num; quit;
/* Create a macro to iterate over the filenames, read them in, and append to a data set. */
%macro doit;
%do i=1 %to #
proc sql noprint;
select filename into :filename from fnames where n=&i;
quit;
data ds;
infile &filename;
input ...list of variable names...;
...other statements...;
run;
proc append data=ds base=final; run;
%end;
%mend;
%doit;
あなたはCSVファイルのn個の数を含むフォルダのn個の数を持っていますか?あなたはUnix、Windows、メインフレームですか? –
はい、n個のcsvファイルを含むn個のフォルダがあります。私はWindows上にいる。私はSASの初心者であり、本当にこの問題に悩まされています。どうもありがとう! – user1106772
「列を数値にする必要がある」とはどういう意味ですか?文字値は数値として格納できません。 – itzy