Trying to save a gauge to a png file on a UNIX box and cannot get it working correclty. Thanks for any help!
Code trying to run.
ods listing;
ods html
path='/sas/data/shared_data/Projects/company_metrics/safety/output/'
gpath='/sas/data/shared_data/Projects/company_metrics/safety/output/'
file='DART_GG.html'
;
ods graphics on / reset=index reset=all
imagefmt=png
imagemap=on
imagename="DART_GG"
border=off;
proc gkpi mode=raised;
dial actual=&actl_Dart
bounds=(&max_Dart &q3_Dart &q2_Dart &q1_Dart &min_Dart) /
label="DART Rate"
colors=(red,yellow,green,blue)
target=&trgt_Dart
format="comma15.2"
lfont=(f="Albany AMT" height=1.0cm)
afont=(f="Albany AMT" height=0.5cm)
bfont=(f="Albany AMT" height=0.4cm) ;
run;
ods html close;
ods graphics on / reset=all;
Error that I get.
ERROR: Physical file does not exist, /sas/work/SAS_work068A017D0006_wasascsprd2.nu.com/_BCD0082C07F11E5B49DD64A229B070B.PNG.
ERROR: Physical file does not exist, /sas/work/SAS_work068A017D0006_wasascsprd2.nu.com/_BD0BE70C07F11E5B49DD64A229B070B.PNG.
Figured out how to rename the png file, code below. The png file can be renamed in the proc, in bold below. Thanks for your help.
ods html
path="&download_from"
file="DART_GG.html"
gpath="&download_from"
;
proc gkpi mode=raised;
dial actual=&actl_Dart bounds=(&max_Dart &q3_Dart &q2_Dart &q1_Dart &min_Dart) /
name="DART_GG"
label="DART Rate"
colors=(red,yellow,green,blue)
target=&trgt_Dart
format="comma15.2"
lfont=(f="Albany AMT" height=1.0cm)
afont=(f="Albany AMT" height=0.5cm)
bfont=(f="Albany AMT" height=0.4cm)
;
run;quit;
ods html close;
ods graphics on / reset=all;
You may want BODY= instead of File=
Also GKPI is not an ODS graphics procedure so the file isn't created with the name or location you are intending. You have to specify DEVICE=JAVAIMG in a GOPTIONS statement as well.
The GKPI procedure also supports run groups so requires a QUIT; statement to end the procedure. So your procedure is still running when you attempt to close the destination and bad things ensue.
Thanks for your help made the changes that you suggested. Is there a way to rename the png file that gets produced. I can rename the html file but not the png.
Make sure folder c:\temp\ has right to write .
ods listing gpath='c:\temp\' ;
ods html
path='c:\temp\'
file='DART_GG.html'
;
ods graphics on / reset=index reset=all
imagefmt=png
imagemap=on
imagename="DART_GG"
border=off;
proc gkpi mode=raised;
dial actual=&actl_Dart
bounds=(&max_Dart &q3_Dart &q2_Dart &q1_Dart &min_Dart) /
label="DART Rate"
colors=(red,yellow,green,blue)
target=&trgt_Dart
format="comma15.2"
lfont=(f="Albany AMT" height=1.0cm)
afont=(f="Albany AMT" height=0.5cm)
bfont=(f="Albany AMT" height=0.4cm) ;
run;
ods html close;
ods graphics on / reset=all;
Thanks for your help. Made the changes that you suggested and I am not getting the error but I am stll not able to rename the png file that gets generated along with the html file. Based on the previous post it seems that the ods graphics does not work with the gkpi image so I cannot figure out how to rename the png file.
ods html
path="&download_from"
file="DART_GG.html"
gpath="&download_from"
;
ods graphics on / reset=index
imagefmt=png
imagename="Test"
;
proc gkpi mode=raised;
dial actual=&actl_Dart
bounds=(&max_Dart &q3_Dart &q2_Dart &q1_Dart &min_Dart) /
label="DART Rate"
colors=(red,yellow,green,blue)
target=&trgt_Dart
format="comma15.2"
lfont=(f="Albany AMT" height=1.0cm)
afont=(f="Albany AMT" height=0.5cm)
bfont=(f="Albany AMT" height=0.4cm) ;
run;quit;
ods html close;
ods graphics on / reset=all;
Figured out how to rename the png file, code below. The png file can be renamed in the proc, in bold below. Thanks for your help.
ods html
path="&download_from"
file="DART_GG.html"
gpath="&download_from"
;
proc gkpi mode=raised;
dial actual=&actl_Dart bounds=(&max_Dart &q3_Dart &q2_Dart &q1_Dart &min_Dart) /
name="DART_GG"
label="DART Rate"
colors=(red,yellow,green,blue)
target=&trgt_Dart
format="comma15.2"
lfont=(f="Albany AMT" height=1.0cm)
afont=(f="Albany AMT" height=0.5cm)
bfont=(f="Albany AMT" height=0.4cm)
;
run;quit;
ods html close;
ods graphics on / reset=all;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: