Hi,
I want to make more than 1 title (multi title / multi cell) in 1 row with ods excel.
What I want is
only 1 title like this is
ods excel file= "D:\test.xlsx" ;
proc odstext;
p "A";
run;
proc print data=sashelp.heart(obs=5);
var Status;
run;
ods excel close;
For get what I want, I change odstext to
proc odstext;
p "A" "B" "C";
run;
but it failed like this
667 proc odstext;
668 p "A" "B" "C";
___
22
76
ERROR: Syntax error while parsing WHERE clause.
ERROR 22-322: Syntax error, expecting one of the following: ;, !, !!, &, *, **, +, -, /, <, <=, <>, =, >, >=, ?, AND, BETWEEN,
CONTAINS, EQ, GE, GT, IN, IS, LE, LIKE, LT, NE, NOT, NOTIN, OR, ^, ^=, |, ||, ~, ~=.
ERROR 76-322: Syntax error, statement will be ignored.
669 run;
I'm happy if someone help me.
I found a way for this with "declare odsout".
https://www.lexjansen.com/phuse/2014/cs/CS01_ppt.pdf
ods excel file= "D:\test.xlsx" ;
data _null_;
declare odsout o();
o.table_start();
o.row_start();
o.format_cell(text: 'text 1');
o.format_cell(text: 'text 2');
o.row_end();
o.row_start();
o.format_cell(text: 'text 3');
o.format_cell(text: 'text 4');
o.row_end();
o.table_end();
o.delete();
run;
proc print data=sashelp.heart(obs=5);
var Status;
run;
ods excel close;
Thank you, but your comment might be for my another question.[ Sheet_Interval='none' ]
I found a way for this with "declare odsout".
https://www.lexjansen.com/phuse/2014/cs/CS01_ppt.pdf
ods excel file= "D:\test.xlsx" ;
data _null_;
declare odsout o();
o.table_start();
o.row_start();
o.format_cell(text: 'text 1');
o.format_cell(text: 'text 2');
o.row_end();
o.row_start();
o.format_cell(text: 'text 3');
o.format_cell(text: 'text 4');
o.row_end();
o.table_end();
o.delete();
run;
proc print data=sashelp.heart(obs=5);
var Status;
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.