创建Excel文件肯定有限制,但不是CSV文件.以下是使用虚拟SAS数据集的示例:
data a;
array x(*) x1-x1790;
do j=1 to 5;
do i=1 to dim(x);
x(i) = ranuni(0);
end;
output;
end;
run;
proc export data=a
outfile="c:\temp\tempfile.csv"
dbms=CSV
replace;
run;
Run Code Online (Sandbox Code Playgroud)
以下是相关日志:
NOTE: The file 'c:\temp\tempfile.csv' is:
Filename=c:\temp\tempfile.csv,
RECFM=V,LRECL=32767,File Size (bytes)=0,
Last Modified=23Jan2013:15:27:13,
Create Time=23Jan2013:15:27:13
NOTE: 6 records were written to the file 'c:\temp\tempfile.csv'.
The minimum record length was 9636.
The maximum record length was 23087.
NOTE: There were 5 observations read from the data set WORK.A.
NOTE: DATA statement used (Total process time):
real time 0.26 seconds
cpu time 0.09 seconds
5 records created in c:\temp\tempfile.csv from A.
NOTE: "c:\temp\tempfile.csv" file was successfully created.
NOTE: PROCEDURE EXPORT used (Total process time):
real time 2.04 seconds
cpu time 0.26 seconds
Run Code Online (Sandbox Code Playgroud)
请注意,第一行包含列标题.
更新:如果您有最新版本的SAS(9.3 TS1M1或更高版本),则可以创建Office 2010 Excel电子表格,其最多包含1,048,576行,16,384列.在那种情况下,你会使用DBMS=XLSX.