Data visualization with SAS programming

ODS HTML with proc tree

Reply
Contributor
Posts: 56

ODS HTML with proc tree

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;

Contributor
Posts: 37

Re: ODS HTML with proc tree

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

Contributor
Posts: 56

Re: ODS HTML with proc tree

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

Contributor
Posts: 37

Re: ODS HTML with proc tree

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

Contributor
Posts: 56

Re: ODS HTML with proc tree

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
Posts: 18,997

Re: ODS HTML with proc tree

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;

Contributor
Posts: 56

Re: ODS HTML with proc tree

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
Posts: 18,997

Re: ODS HTML with proc tree

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?

Contributor
Posts: 56

Re: ODS HTML with proc tree

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.


Ask a Question
Discussion stats
  • 8 replies
  • 616 views
  • 0 likes
  • 3 in conversation