BookmarkSubscribeRSS Feed
Obsidian | Level 7

I want to redirect output of the proc tree output (decision tree) to Excel or HTML . I tried below code for HTML output .

The issue I face is , HTML output is nice when seen in output window in SAS Enterprise guide but when file is open from the location where it is saved I get 'cross' mark .

Any solutions to this ? sample code is taken from sas support web of proc tree. attached is output as seen.

data teeth;
      title 'Mammals'' Teeth';
      input mammal $ 1-16 @21 (v1-v8) (1.);
      label V1='Right Top Incisors'
            V2='Right Bottom Incisors'
            V3='Right Top Canines'
            V4='Right Bottom Canines'
            V5='Right Top Premolars'
            V6='Right Bottom Premolars'
            V7='Right Top Molars'
            V8='Right Bottom Molars';
Brown Bat          23113333
Mole                32103333
Silver Hair Bat    23112333
Pigmy Bat          23112233
House Bat          23111233
Red Bat            13112233
Pika                21002233
Rabbit              21003233
Beaver              11002133
Groundhog          11002133
Gray Squirrel      11001133
House Mouse        11000033
Porcupine          11001133
Wolf                33114423
Bear                33114423
Raccoon            33114432
Marten              33114412
Weasel              33113312
Wolverine          33114412
Badger              33113312
River Otter        33114312
Sea Otter          32113312
Jaguar              33113211
Cougar              33113211
Fur Seal            32114411
Sea Lion            32114411
Grey Seal          32113322
Elephant Seal      21114411
Reindeer            04103333
Elk                04103333
Deer                04003333
Moose              04003333
      proc cluster method=average std pseudo noeigen outtree=tree;
      id mammal;
      var v1-v8;

ods html path='path-of-the-file' file='testme.html' ;

  proc tree horizontal;
ods _all_ close;

Fluorite | Level 6


I ran the code and I can see the html output nice and clean. What's exactly happening when you say "You got a cross mar" ?



Obsidian | Level 7

Where do you see good output ? In SAS Window or html file opened from the location where it is saved once program is executed . See below image for output. A small CROSS mark instead of image . output_proctree.jpg

Fluorite | Level 6

Looks more of a problem with your browser . I can view the result in the html file.


Check if something is blocking in your browser. Try to enable blocked contents if any

Obsidian | Level 7

Did you execute the code using SAS EG or from command line? Just to be sure you opened file from location where it was saved not from sas window . right? Also did you use windows sas or linux?

Super User

Try specifying the GPATH= option? It should be set to the default of the PATH but perhaps it's not.

Where you find the HTML file do you see the image files as well?

ods html path='path-of-the-file' file='testme.html'  gpath='path-of-the-file';

  proc tree horizontal;
ods _all_ close;

Obsidian | Level 7

I tried gpath option also but in vein . i noticed one thing , I get a message that "Error to help protect your security, Internet Explorer has restricted this webpage from running scripts or ActiveX controls that could access your computer"

Can this cause problem?

Super User

Yes, as mentioned above use a different browser or enable the scripts/ActiveX controls.

Or just open the image files directly unless you need the HMTL file?

Obsidian | Level 7

I tried google chrome also but did not work. Strange part is it did work few days back on the same browser(IE).

May be my computer's settings have been changed as I am not admin of my PC.



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg



Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 8 replies
  • 3 in conversation