I have three macros below which creates three excel reports with multiple sheets inside.
**12 months**
%metrics(score =y,vintage=y,excel=excel1);
**06 months**
%metrics(score =y,vintage=y,excel=excel2)
**18 months**
%metrics(score =y,vintage=y,excel=excel3)
when i run this SAS it creates three excel sheets with multiple sheets in winscp location sas/output
I want to know how to create a single excel picking up particular sheets from each three excel and output it into new excel document below these three macros and output it in same winscp location.
ods excel file="\myserver\myfolder\myexcelfile.xlsx" options(sheet_name='SheetName1');
... some SAS code ...
ods excel options(sheet_name='SheetName2');
... some SAS code ...
ods excel options(sheet_name='SheetName3');
... some SAS code ...
ods excel close;
Above is the general approach. Of course, we don't know what your macro %METRICS does, so there may be other approaches.
It doesn't read multiple Excel sheets. You don't create multiple Excel files. You run the code above to create one Excel file with multiple worksheets.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.