BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
magicdj
Obsidian | Level 7

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.

 

magicdj_0-1716393563237.png

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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;

View solution in original post

7 REPLIES 7
Reeza
Super User
Add NOOBS to proc print statement to remove the OBS.

Changing the spacing is a bit harder unfortunately 😞

proc print data=set1 NOOBS;
magicdj
Obsidian | Level 7

so there is no way to remove title? that's sad. noobs works

PaigeMiller
Diamond | Level 26

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');

 

--
Paige Miller
magicdj
Obsidian | Level 7

thanks for reply. tried both. none of them working, not sure why

PaigeMiller
Diamond | Level 26

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).

--
Paige Miller
Reeza
Super User

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;
magicdj
Obsidian | Level 7

 

 

thanks Reeza and Paige.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 501 views
  • 0 likes
  • 3 in conversation