BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Caro17
Calcite | Level 5

Hey,

 

I am using this code:

 

data want;

set order;

length order_no_str $100;

order_no_str = cats(put(lngorder_no, 8.),',');

run;

ods excel file='\\abc\agency\\order2020.xlsx’;

proc print data=want;

run;

ods excel close;

 

How can I "delete" the header? 

 

Do I really need proc print? It is not necessary to see it in SAS again. Can I suppress it?

 

Thanx!

Caro

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

So what you meant are the column headers. Title has, in SAS, a different connotation, meaning the page headers created through the TITLE statements.

 

As @Ksharp suggested, you can suppress the column headers in PROC REPORT with the NOHEADER option.

This code

ods excel file='/folders/myfolders/class.xlsx';

proc report data=sashelp.class noheader;
run;

ods excel close;

created a sheet like this:

Bildschirmfoto 2020-11-09 um 08.03.08.png

View solution in original post

7 REPLIES 7
Kurt_Bremser
Super User

If, by "header", you mean the page title, you can remove it by issuing an empty TITLE statement.

If you just want to bring your raw data to Excel, use PROC EXPORT with DBMS=XLSX, or LIBNAME XLSX instead of ODS EXCEL. ODS EXCEL is good mainly for "prettying up" the Excel spreadsheet.

Caro17
Calcite | Level 5
"header" is the title of the column.

What do you mean by "empty TITLE statement"? Do you mean TITLE ''?

I still have the title of the column.
Kurt_Bremser
Super User

So what you meant are the column headers. Title has, in SAS, a different connotation, meaning the page headers created through the TITLE statements.

 

As @Ksharp suggested, you can suppress the column headers in PROC REPORT with the NOHEADER option.

This code

ods excel file='/folders/myfolders/class.xlsx';

proc report data=sashelp.class noheader;
run;

ods excel close;

created a sheet like this:

Bildschirmfoto 2020-11-09 um 08.03.08.png

Ksharp
Super User
1)
proc print data=want split='*' ;
run;

2)
proc report data=want nowd noheader ;
run;
Caro17
Calcite | Level 5
Neither 1) nor 2) leads to the wished result. I still have the title of the column.
andreas_lds
Jade | Level 19

@Caro17 wrote:
Neither 1) nor 2) leads to the wished result. I still have the title of the column.

Please post the code you have used, because when i execute the following code the result is as expected:

ods excel file="dummy.xlsx";

proc report data=sashelp.class noheader;
run;

ods excel close;

excel_no_header.png

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 3397 views
  • 2 likes
  • 4 in conversation