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

Hi,
I want to make more than 1 title (multi title / multi cell) in 1 row with ods excel.
What I want is

what-i-want.jpg

only 1 title like this is 

bef.jpg

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.

1 ACCEPTED SOLUTION

Accepted Solutions
t_ar_taat
Quartz | Level 8

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;

98.jpg

 

View solution in original post

3 REPLIES 3
t_ar_taat
Quartz | Level 8

Thank you, but your comment might be for my another question.[ Sheet_Interval='none' ]

https://communities.sas.com/t5/SAS-Programming/ODS-EXCEL-1-sheet-with-multi-proc-step-no-dividng-sep...

 

t_ar_taat
Quartz | Level 8

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;

98.jpg

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 423 views
  • 0 likes
  • 2 in conversation