BookmarkSubscribeRSS Feed
vomer
Obsidian | Level 7

Hi Anca, the trouble is that my table is setup with names and numbers. Since I cannot "sum" an organization name it looks like that does nothing Smiley Sad

AncaTilea
Pyrite | Level 9

Right, understood.

This is how far I got yesterday;

You want to be able to 'manipulate' (autofilter) a table that looks like this:

Age      Weight     Name

12          100          Mia

13          100          Tia

11          100          Elvis

==          ===              

36          300

What this could translate to:

Age      Weight     Name

12          100          Mia

13          100          Tia

11          100          Elvis

==          ===                   

36          300          &nbsp  <-- which in SAS doesn't show up bc SAS know that is a blank character space something (my understanding is rather limited), BUT when you 'transfer' it to HTML...the HTML 'interpreter" doesn't know what "&nbsp" stands for, hence it "shows" as an option...

So...there are (hard) ways to modify the tableeditor template such that when there is "blank" to not replace it with (SAS friendly) "&nbsp"...

So my next step is to google autofilter tables created from SAS and figure out how to suppress the &nbsp...


OK, I shall be back.

AncaTilea
Pyrite | Level 9

Ok,Vomer.

I am going to end here with my final findings Smiley Happy

(I think you should have SAS look into this).

I don't think there is a simple way for you to have "&nbsp" not show.

BUT

you could run the following piece of code:

proc template;

source tagsets.tableeditor/file = "your_path/to_edit.sas";

run;

This code will save the template of tagsets.tableeditor that you are currently using.

ok.

So open that SAS file (saved in your_path/to_edit.sas) (you will notice it is very long but don't despair).

First write PROC TEMPLATE; on the first line.

Then you will see 'define tagset tagsets.tableeditor....change tableeditor to vomer_table

(You don't want to overwrite the existing tableeditor template)

OK.

Then CTRL+F and "&nbsp" and on line 4207 you see it there...? and on line 4210.

These are the only two times it shows in the template.

So, what I've been trying to do, is edit this, save it as my own table_editor version and re-run the proc print with my template.

It doesn't work.

So, this is way above my head!

Best of luck and please do let us know if you find the solution (as I will,too).

Cheers!

Anca.

AncaTilea
Pyrite | Level 9

Hi again.

So, here is my work-around:

First perform a PROC MEANS or PROC SUMMARY with the SUM option, save the values int a data set (using ODS Output Summary = temp)..

Then do some manipulations such as:

if org = "" then org = "Total Profit"...or whatever you need, so at the end you get a table like this:

                                 name     AgeHeight

                               Alice     13 56.5
                               Barbara   13 65.3
                               Carol     14 62.8
                               Jane      12 59.8
                               Janet     15 62.5
                               Joyce     11 51.3
                               Judy      14 64.3
                               Louise    12 56.3
                               Mary      15 66.5
                               Total Age119   .

I haven't yet come up with a smart way to give height a value if "."....

Here is my code:

proc means data = sashelp.class sum;
    var age;
    where sex = "F";
    ods output Summary = s;
run;

data to_print(keep = name age height);
length name $10;
    set sashelp.class(where = ( sex = "F")) s;
if name = "" then name = "Total Age";
if age = . then age = age_sum;
run;

ods tagsets.tableeditor file = "to_dlt.html"

path="\\cumulus\share\atilea" (url=none)
style=styles.default
options(toc_background="white"
           toc_expand="yes"
            toc_print="yes"
autofilter="yes" filter_cols="1,2,3" AUTOFILTER_ENDCOL="3" frozen_headers="yes"
pageheight="400" autofilter_width="15em");

proc print data=to_print noobs label;
run;

ods tagsets.tableeditor close;

vomer
Obsidian | Level 7

Hi Anca, thanks so much for investigating. I will try the first custom tagset method and see if I get anywhere. Looks like I can call on a custom table template using the %include statement.

Perhaps I should also contact sas regarding this issue as well as you suggested. Smiley Happy

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 19 replies
  • 1468 views
  • 7 likes
  • 3 in conversation