BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

I am using the HTMLPANEL markup and i would like to populate one of the cells with a simple put statement (not with a proc).

Here is my idea :
ods tagsets.htmlpanel event=row_panel(start);
ods tagsets.htmlpanel event=column_panel(start);

data _null_ ;
file print ;
put "" ;
run;


goptions xpixels=240 ypixels=240;
proc gchart data=sashelp.class;
pie age / sumvar=weight;
run;
quit;

ods tagsets.htmlpanel event=column_panel(finish);

it works but the data _null_ generate an ugly formated cell ... is there a way to prevent it ?

BR,

Greg
2 REPLIES 2
DanH_sas
SAS Super FREQ
The contents of the PUT statement appear as an icon in the post. Were you trying to put string data into the cell?

Thanks!
DanH
Cynthia_sas
Diamond | Level 26
Hi:
Do you want to just write text with your PUT statement. There are 2 different ways to write text so that it doesn't look "ugly" -- what you're seeing is the "batch" form of output when you use the "older" FILE PRINT insstead of the "newer" FILE PRINT ODS. The two methods are:
-- use FILE PRINT ODS (which puts the text into a table)
-- create a SAS dataset with your TEXT and then use PROC REPORT or PROC PRINT and turn off the interior table lines with STYLE overrides

There is a third method, but it involves using the experimental interface between the Data Step and ODS and is described here:
http://www2.sas.com/proceedings/sugi28/022-28.pdf
http://support.sas.com/rnd/base/datastep/dsobject/

At any rate, the program below illustrates the first two methods with HTMLPANEL.

cynthia
[pre]
ODS tagsets.htmlpanel nogtitle style=sasweb
path='c:\temp\' (url=none)
body="Jabberwocky.html"
options( panelcolumns='2' doc='help'
panelborder='2'
panelrows='2'
embedded_titles='Yes'
bylabels='no');

ods escapechar='^';

ODS tagsets.htmlpanel event=row_panel(start);

goptions device=actximg;

proc gchart data=sashelp.shoes;
where region in ('Asia', 'Canada', 'Pacific');
title 'Casual Shoes';
where also product contains 'Casual';
vbar region / sumvar=sales type=mean name='csl';
run;
quit;
run;

title 'Comment';
data _null_;
length Jabberwocky $1000;
file print ods;
Jabberwocky = 'Twas brillig and the slithy toves';
put _ods_;
Jabberwocky = 'Did gyre and gimble in the wabe';
put _ods_;
Jabberwocky = 'All mimsy were the borogroves';
put _ods_;
Jabberwocky = 'And the mome raths outgrabe';
put _ods_;
Jabberwocky = '--- by Lewis Carroll';
put _ods_;
run;

ODS tagsets.htmlpanel event=row_panel(finish);

ODS tagsets.htmlpanel event=row_panel(start);


proc gchart data=sashelp.shoes;
where region in ('Asia', 'Canada', 'Pacific');
title 'Shoes for Women';
where also product contains 'Women';
vbar region / sumvar=sales type=mean name='fem';
run;
quit;
run;


data Jabber;
length Jabberwocky $1000;
Jabberwocky = 'Twas brillig and the slithy toves';
lineord = 1; output;
Jabberwocky = 'Did gyre and gimble in the wabe';
lineord = 2; output;
Jabberwocky = 'All mimsy were the borogroves';
lineord = 3; output;
Jabberwocky = 'And the mome raths outgrabe';
lineord = 4; output;
Jabberwocky = '--- by Lewis Carroll';
lineord = 5; output;
Jabberwocky = ' ';
lineord = 6; output;
Jabberwocky = 'Really, the most sensible ^n shoes for people ^n are shoes with '||
'very good ^n arch support ^n and sturdy heels. More stuff. More stuff. '||
'more and more and more. Twinkle twinkle little star. Supercalifragilisticexpealidocious '||
'is a favorite word of my favorite nanny.';
lineord=7; output;
run;

proc report data=Jabber nowd noheader
style(report)={rules=none frame=void cellspacing=0 cellpadding=0};
title 'Jabberwocky';
column lineord Jabberwocky;
define lineord / order noprint;
define Jabberwocky / style(column)={just=left font_weight=bold} ;
run;

ODS tagsets.htmlpanel event=row_panel(finish);

ODS tagsets.htmlpanel close;

[/pre]

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

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!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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