BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
LB
Quartz | Level 8 LB
Quartz | Level 8

hello all- little stuck. 

I am running SAS  9.4 (I think TM3) off a linux server.  I am attempting to export graphs into an excel report w/o success. 

From the code below, which I borrowed off the internet, the table exports just fine, but the graph does not render within the finalized excel document although it does show in the results table. 

 

I apologize in advance if someone recognizes their code, but this is inncoculous vs PHI data that I am trying to render- 

Any suggestions welcomed.  Not sure if I should contact SAS technical support. 

 

data my_data;
input item $ 1-6 Amount Purchase_date date9.;
datalines;
ITEM A 11.8 14nov2016
ITEM B 10.5 01jul2016
ITEM C 8.8 22feb2015
ITEM D 6.8 01apr2012
ITEM E 3.9 03aug2016
ITEM F 2.3 02mar2016
;
run;

ods listing close;
ods excel file="/apps/sas/datasets/data137/NCQOS/dev/nc_qos_sandbox/data/dfrx/xxx.xlsx" style=htmlblue;

goptions gunit=pct htitle=6 ftitle="albany amt/bold"
htext=3.5 ftext="albany amt/bold" ctext=gray33;

axis1 label=none value=(justify=right);
axis2 label=('AMOUNT') order=(0 to 12 by 2) minor=none offset=(0,0);

pattern v=solid color=dodgerblue;

ods excel options(SHEET_NAME='Graph');

title1 ls=1.5 "Simple Bar Chart";
proc gchart data=my_data;
format amount dollar5.0;
hbar item / discrete type=sum sumvar=amount nostats
maxis=axis1 raxis=axis2 noframe
autoref clipref cref=graycc;
run;

ods excel options(SHEET_NAME='Data' EMBEDDED_TITLES='yes' START_AT='3,2');

title c=gray33 "Raw Data Values";
proc print data=my_data noobs label;
label purchase_date='Purchase date';
format amount dollar5.2;
format purchase_date date9.;
run;

quit;
ods excel close;

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisHemedinger
Community Manager

Try setting:

 

options dev=PNG; 

 

before running the GCHART step.

Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.

View solution in original post

6 REPLIES 6
Reeza
Super User

Verify your SAS version, I believe ODS is experimental before T3. 

 

Proc setinit;run;

 

https://support.sas.com/resources/papers/proceedings16/SAS5642-2016.pdf

 

PS. This assumes your code works and it's just an issue getting it into the Excel report. 

And re-using code on here is fine, ideally credited but not required. Just don't say it's yours if it's not. 

 

 

LB
Quartz | Level 8 LB
Quartz | Level 8

Reeza; 

 

Current version: 9.04.01M3P062415 per proc setinit;  

 

Thanks 

 

Lawrence 

 

ChrisHemedinger
Community Manager

Try setting:

 

options dev=PNG; 

 

before running the GCHART step.

Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.
LB
Quartz | Level 8 LB
Quartz | Level 8

Chris- 

Chicken dinner we have a winner! 

Thank you all for your quick and helpful responses! 

 

Lawrence 

ballardw
Super User

And yet another reason to move to SGPLOT.

LB
Quartz | Level 8 LB
Quartz | Level 8

Totally forgot about SGPLOT. Been awhile since I  have dealt  with ODs graphics.  

Thanks -This is working much better! 

 

Lawrence 

 

 

 

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 6 replies
  • 2569 views
  • 2 likes
  • 4 in conversation