I have this script below. When the excel file is generated the field reporting_quarter actually gets truncated and only "Reportin" is displayed. Any ideas how to overcome the issue? Thanks!
data tmp;
attrib memberno label="Member_No" length=$11 format=$11. informat=$11.;
attrib previous_risk_category label="Previous Risk Category" length=$11 format=$11. informat=$11.;
attrib current_risk_category label="Current Risk Category" length=$11 format=$11. informat=$11.;
attrib previous_risk_score label="Previous Risk Score" length=8 format=best32. informat=best32.;
attrib current_risk_score label="Current Risk Score" length=8 format=best32. informat=best32.;
attrib reasons label="Reasons" length=$250 format=$250. informat=$250.;
memberno="1111111111";
previous_risk_category="Elevated";
current_risk_category="High";
previous_risk_score=5;
current_risk_score=7;
reasons="abcd[0,2];";
attrib reporting_quarter length=$20 format=$20. informat=$20.;
reporting_quarter=put("31mar2014"d,yyq6..);
run;
EDIT: Will simply adding the label for reporting_quarter fix the issue? Thanks!
proc export
outfile="C:\excelout.xls"
dbms=excel4 replace label;
run;
Try changing your DBMS as well, if label doesn't work.
Try Excel as a starter.
Label is a SAS 9.2+ feature at least I think, so if you're on 9.1 you may be out of luck.
It is weird . I am not getting any truncated problem.
data tmp; attrib memberno label="Member_No" length=$11 format=$11. informat=$11.; attrib previous_risk_category label="Previous Risk Category" length=$11 format=$11. informat=$11.; attrib current_risk_category label="Current Risk Category" length=$11 format=$11. informat=$11.; attrib previous_risk_score label="Previous Risk Score" length=8 format=best32. informat=best32.; attrib current_risk_score label="Current Risk Score" length=8 format=best32. informat=best32.; attrib reasons label="Reasons" length=$250 format=$250. informat=$250.; memberno="1111111111"; previous_risk_category="Elevated"; current_risk_category="High"; previous_risk_score=5; current_risk_score=7; reasons="abcd[0,2];"; attrib reporting_quarter length=$20 format=$20. informat=$20.; reporting_quarter=put("31mar2014"d,yyq6..); run; proc export outfile="C:\temp\excelout.xls" dbms=excel replace ; label; run;
Xia Keshan
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.