BookmarkSubscribeRSS Feed
AkshayS
Fluorite | Level 6

Hi All,

 

I am trying to print both table and bar graph in HTML but able to only get table in output using SAS DI.

Kindly assist me what modification is needed in my below code:

 

ods listing close;
ods html path='/ACTDATA/fireuw/' (url=none)
body='sgplot.html';
goptions reset=all;

PROC SQL;
create table CARS1 as
SELECT make, model, type, invoice, horsepower, length, weight
FROM
SASHELP.CARS
WHERE make in ('Audi','BMW')
;
RUN;
proc print;
quit;


proc SGPLOT data = cars1;
vbar length /group = type GROUPDISPLAY = CLUSTER;
title 'Cluster of Cars by Types';
run;
quit;


ods html close;
ods listing;

 

Thanks,

Akshay  

1 REPLY 1
Rama_V
Obsidian | Level 7

Your code is fine and it works. 

 

I believe you are using user written transformation, make sure you refer the output work table(Physical) of user written transformation to cars1 to view the output in DI Studio.

 

Or change the code to below. After running it, right click on the work table output connected to user written transformation and then select update metadata. If the option is disable try after saving the job.

 

 


ods listing close;
ods html path='/ACTDATA/fireuw/' (url=none)
body='sgplot.html';
goptions reset=all;

PROC SQL;
create table &_output1. as
SELECT make, model, type, invoice, horsepower, length, weight
FROM
SASHELP.CARS
WHERE make in ('Audi','BMW')
;
RUN;
proc print;
quit;


proc SGPLOT data = &_output1.;
vbar length /group = type GROUPDISPLAY = CLUSTER;
title 'Cluster of Cars by Types';
run;
quit;


ods html close;
ods listing;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 704 views
  • 0 likes
  • 2 in conversation