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
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:
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.
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:
@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;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.