尽管我只有 3200 条记录,但此代码生成的文件大小大于 5MB。有什么建议么 ?帮助将不胜感激。从过去的两天开始,我一直在努力解决它。
它给了我内存不足的错误。我还有其他与这个非常相似的代码,我能够运行该代码而不会出现任何错误。
%macro report(date);
%let a= %eval(%sysfunc(today());
%let Year= %sysfunc(putn(&a,year4.));
%let Mon= %sysfunc(putn(&a,month2.));
%let Day= %sysfunc(putn(&a,day2.));
Proc SQL;
Create table vdata.Report as
Select Country, Province, City, Code, Link, Activity, First_Name, Last_Name,
Is_Coordinator, Is_Host, email, Phone, Business_Group, Managers_Email, Transportation
from V_Data.raw_plus_&date;
Quit;
Proc Sort data=vdata.PM_Report;
by Country Province Activity Last_Name;
run;
ods listing close;
ods tagsets.EXCELXP file="/path/ Report - &date..XML";
ods tagsets.ExcelXP options (Sheet_name="Report");
proc report data=vdata.Report nowd
style(header)=[font_weight=bold background=cxDCE6F1 font_size=1.2 ]
;
COLUMN ("Registration as of &Year-&Mon-&Day" ("Report" Country Province City Code Link Activity First_Name Last_Name
Is_Coordinator Is_Host email Phone Business_Group Managers_Email Transportation));
DEFINE Country / Display FORMAT= $char100. Style(column)=[WIDTH=75 font_size=1] style(header)=[background = CXC2D69A] SPACING=2 LEFT "Country" ;
DEFINE Province / Display FORMAT= $char100. Style(column)=[WIDTH=60 font_size=1] style(header)=[background = CXC2D69A] SPACING=2 LEFT "Province";
DEFINE City / Display FORMAT= $char100. Style(column)=[WIDTH=80 font_size=1] style(header)=[background = CXC2D69A] SPACING=2 LEFT "City" ;
DEFINE Code / Display FORMAT= $char100. Style(column)=[WIDTH=170 font_size=1] style(header)=[background = CXC2D69A] SPACING=2 Left "Project ID#" ;
DEFINE Link / Display FORMAT= $char100. Style(column)=[WIDTH=200 font_size=1] style(header)=[background = CXC2D69A] SPACING=2 left "Region" ;
DEFINE Activity / Display FORMAT= $char100. Style(column)=[WIDTH=500 font_size=1] style(header)=[background = CXC2D69A] SPACING=2 left "Select an Activity" ;
DEFINE First_Name / Display FORMAT= $char100. Style(column)=[WIDTH=90 font_size=1] style(header)=[background = CXC2D69A] SPACING=2 left "First Name" ;
DEFINE Last_Name / Display FORMAT= $char100. Style(column)=[WIDTH=220 font_size=1] style(header)=[background = CXC2D69A] SPACING=2 left "Last Name" ;
DEFINE Is_Coordinator / Display FORMAT= $char100. Style(column)=[WIDTH=120 font_size=1] style(header)=[background = CXC2D69A] SPACING=2 left "Activity Coordinator" ;
DEFINE Is_Host / Display FORMAT= $char100. Style(column)=[WIDTH=80 font_size=1] style(header)=[background = CXC2D69A] SPACING=2 left "Host" ;
DEFINE Email / Display FORMAT= $char100. Style(column)=[WIDTH=250 font_size=1] style(header)=[background = CXC2D69A] SPACING=2 left "e-mail" ;
DEFINE Phone / Display FORMAT= $char100. Style(column)=[WIDTH=100 font_size=1] style(header)=[background = CXC2D69A] SPACING=2 left "phone #" ;
DEFINE Business_Group / Display FORMAT= $char100. Style(column)=[WIDTH=270 font_size=1] style(header)=[background = CXC2D69A] SPACING=2 left "Business Group" ;
DEFINE Managers_Email / Display FORMAT= $char100. Style(column)=[WIDTH=220 font_size=1] style(header)=[background = CXC2D69A] SPACING=2 left "Reporting Managers Email" ;
DEFINE Transportation / Display FORMAT= $char100. Style(column)=[WIDTH=220 font_size=1] style(header)=[background = CXC2D69A] SPACING=2 left "Transportaion needed?" ;
Compute country;
if country = "Canada" then
call define(_row_, 'style', 'style = {background=#FFFFFF FONT_SIZE=1}' );
else if country = "United States" then
call define(_row_, 'style', 'style = {background=#FFFFFF FONT_SIZE=1}' );
endcomp;
RUN;
ODS ods tagsets.ExcelXP CLOSE;
%Mend;
提前致谢。