Is there a way to remove the border when outputting the log into ODS EXCEL? I'm running SAS 9.4 M4.
Code:
filename test "K:\SAS\logs\log.log";
proc printto log=test new; run;
ODS excel file="K:\SAS\logs\test.xlsx" options(sheet_interval="none");
proc printto;run;
proc document name=mydoc(write);
import textfile=test to logfile;run;
replay;run;
quit;
ODS excel close;
I tried the following styles to no avail as well as the grindlines="no" option.
proc template;
define style styles.test;
parent=styles.default;
style table from table /
borderwidth=0
cellspacing=0;
end;
run;
proc template;
define style styles.noborder;
class table /
borderwidth=0
rules=none
frame=void
cellspacing=0
background=white;
end;
run;
Any help is appreciated. Thanks.
This works:
filename test "%sysfunc(pathname(WORK))\log.log";
proc printto log=test new; run;
data T; run;
proc printto;run;
ODS excel file="%sysfunc(pathname(WORK))\test.xlsx" options(sheet_interval="none");
data _null_;
if _n_ = 1 then do;
declare odsout ODS();
end;
infile "%sysfunc(pathname(WORK))\log.log";
input;
ODS.format_text(data: _infile_);
run;
ODS excel close;
This works:
filename test "%sysfunc(pathname(WORK))\log.log";
proc printto log=test new; run;
data T; run;
proc printto;run;
ODS excel file="%sysfunc(pathname(WORK))\test.xlsx" options(sheet_interval="none");
data _null_;
if _n_ = 1 then do;
declare odsout ODS();
end;
infile "%sysfunc(pathname(WORK))\log.log";
input;
ODS.format_text(data: _infile_);
run;
ODS excel close;
Thanks for the solution! I'm a bit new to the ODS language but I'm guessing your method reads in a log text file which is then outputted into ODS inside a data step. And the format_text function removes the borders for some reason.
I am discovering the ODSOUT object too. It looks very useful.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.