I have a simple Proc Export that is looped to create a multi-tabbed spreadsheet. Its worked for years. I recently reinstalled SAS after purchasing SAS/STAT. Now, there is only the last database in a tab. The log shows no errors and that all sheets were created. It looks like each iteration overwrites the previous tab. Worked for years. Any clue?
%MACRO DOIT(OUTDATA,TAB,OUTEXL);
PROC EXPORT DATA=COMPANY.&RESPONDENT._&SEGMENT._&STAGE._&OUTDATA
OUTFILE= "&ROOT\&RESPONDENT._&SEGMENT._&STAGE._Margin Analysis_&OUTEXL"
DBMS=XLSX REPLACE;
SHEET="&TAB";
RUN;
%MEND DOIT;
%DOIT(conmargins,Margins By CONNUM, &sysdate);
%DOIT(hmwtav,Weighted Average NVs, &sysdate);
%DOIT(tranmarg,A to T Margin, &sysdate);
%DOIT(avgmarg,Standard Margin, &sysdate);
%DOIT(concord,Concordance, &sysdate);
%DOIT(unique,Simple Concordance, &sysdate);
%DOIT(unique2,Unique Concordance, &sysdate);
%DOIT(matches,HM Sales matched to US, &sysdate);
Thanks, Reeza. I did not change versions (9.3 before and after). It was a fresh install, so there may have been hotfixes that got installed that were not there beforehand. Was there a hotfix that related to proc export?
Did you really go to the trouble of re-installing SAS and install an 8 year old version?
I ran it without the REPLACE and got this error message. The spreadsheet now has just the 1st dataset rather than just the last one.
NOTE: Export cancelled. Output file C:\SAS Data\Quartz\India\Antique\ANTIQUE_INV_BASE1_Margin Analysis_30OCT19.xlsx already exists. Specify REPLACE option
to overwrite it.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE EXPORT used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.