i found an old post in link below :
my code:
data set1;
set sashelp.baseball ;
run;
proc sort; by team ; run;
ods excel file="C:\Users\test.xlsx" options(sheet_interval='BYGROUP' sheet_interval='BYGROUP' sheet_name= '#byval1' );
proc print data=set1;
by team;
run;
ods excel close;
Solved: export multiple data sets into multiple sheets in excel - SAS Support Communities
the problem is that row 1 has title and row 2 is empty. how to remove row 1 and 2 to make it looks like excel , not report. also for column Obs, is there any possible to delete or use other variable to instead? thanks.
Try the NOBYLINE option.
For some reason I interpreted your question as removing the space (not enough coffee).
options nobyline;
title;
@magicdj wrote:
so there is no way to remove title? that's sad. noobs works
data set1;
set sashelp.baseball ;
run;
proc sort data=set1; by team ; run;
ods excel file="/home/fkhurshed/Demo1/demo_delete.xlsx" options(sheet_interval='BYGROUP' sheet_interval='BYGROUP' sheet_name= '#byval1' );
options nobyline;
title;
proc print data=set1 noobs;
by team;
run;
ods excel close;
so there is no way to remove title? that's sad. noobs works
In SAS, before PROC PRINT, this command works:
title;
OR
ods excel file="C:\Users\test.xlsx" options(sheet_interval='BYGROUP' sheet_interval='BYGROUP' sheet_name= '#byval1'
embedded_titles='NO');
thanks for reply. tried both. none of them working, not sure why
Here in the SAS forums, saying you tried it and it did not work is never sufficient. This gives us no information about what went wrong. You have to show us the code you are using, and the result that isn't what you want. If there is an error in the log, we also need to see the part of the log containing the code of interest (and not just the error messages but the entire code of interest).
Try the NOBYLINE option.
For some reason I interpreted your question as removing the space (not enough coffee).
options nobyline;
title;
@magicdj wrote:
so there is no way to remove title? that's sad. noobs works
data set1;
set sashelp.baseball ;
run;
proc sort data=set1; by team ; run;
ods excel file="/home/fkhurshed/Demo1/demo_delete.xlsx" options(sheet_interval='BYGROUP' sheet_interval='BYGROUP' sheet_name= '#byval1' );
options nobyline;
title;
proc print data=set1 noobs;
by team;
run;
ods excel close;
thanks Reeza and Paige.
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.