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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.