BookmarkSubscribeRSS Feed
ucvikas
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';
      datalines;
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
;
run;
      proc cluster method=average std pseudo noeigen outtree=tree;
      id mammal;
      var v1-v8;
  run;

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

  proc tree horizontal;
  run;
ods _all_ close;

8 REPLIES 8
Karthikeyan
Fluorite | Level 6

HI

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" ?

Thanks

Karthik

ucvikas
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

Karthikeyan
Fluorite | Level 6

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

Capture.PNG

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

ucvikas
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?

Reeza
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;
  run;
ods _all_ close;

ucvikas
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?

Reeza
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?

ucvikas
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.


sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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