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
SAS Super FREQ
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]

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 774 views
  • 0 likes
  • 3 in conversation