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

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Bryan
Obsidian | Level 7

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;

View solution in original post

5 REPLIES 5
ballardw
Super User

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.

Bryan
Obsidian | Level 7

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.

Ksharp
Super User

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;

Bryan
Obsidian | Level 7

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;

Bryan
Obsidian | Level 7

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;

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
  • 5 replies
  • 2183 views
  • 2 likes
  • 3 in conversation