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

I'm running Base 9.4M6 on Linux.  I have an SGPlot module which produces a png file (showing horizontal bar charts of monthly data loaded into various Oracle tables), but I haven't been able to find out how to specify what directory the png file should go to.  Below is the code.

 

*******************************************************;
* Set up plot and plot file location ;
*******************************************************;
** ods body="&out..png" gpath="&outdir";
ods graphics on / imagefmt=png imagename="u01bri_data_ranges_04feb2020_is2" width=10.0in height=6.0in;
title "Main Oracle tables in u01bri.is2";
title2 "Monthly data min and max dates (as of 04feb2020)";
footnote2 h=5pt j=left "/lupra00a0734/usr/u022922/0_CMFPROD/trunk/sgplot/plot_horiz_bar_ora_dates.sas";

proc sgplot data=WORK.u01bri_data_ranges_04feb2020 noborder noautolegend;
    where db_schema = "is2";
    highlow y=db_table low=earliest high=latest 
    / type=bar lowlabel=earliest highlabel=latest grouporder=ascending;
    yaxis label="";
run;
1 ACCEPTED SOLUTION

Accepted Solutions
DougZ
Obsidian | Level 7

Thanks Dan.  I tried that after searching some other posts in the meantime, but get this:

 

MPRINT(PLOT_HORIZ_BAR_ORA_DATES):   ** ods body="&out..png" gpath="&outdir";
MPRINT(PLOT_HORIZ_BAR_ORA_DATES):   ODS LISTING GPATH = "/lupra00a0134/temp/day/";
MPRINT(PLOT_HORIZ_BAR_ORA_DATES):   ods graphics on / imagefmt=png imagename="u01bri_data_ranges_04feb2020_is2" width=10.0in height=6.0in;
MPRINT(PLOT_HORIZ_BAR_ORA_DATES):   title "Main Oracle tables in u01bri.is2";
MPRINT(PLOT_HORIZ_BAR_ORA_DATES):   title2 "Monthly data min and max dates (as of 04feb2020)";
MPRINT(PLOT_HORIZ_BAR_ORA_DATES):   footnote2 h=5pt j=left "/lupra00a0734/usr/u022922/0_CMFPROD/trunk/sgplot/plot_horiz_bar_ora_dates.sas";
MPRINT(PLOT_HORIZ_BAR_ORA_DATES):   proc sgplot data=WORK.u01bri_data_ranges_04feb2020 noborder noautolegend;
MPRINT(PLOT_HORIZ_BAR_ORA_DATES):   where db_schema = "is2";
MPRINT(PLOT_HORIZ_BAR_ORA_DATES):   highlow y=db_table low=earliest high=latest / type=bar lowlabel=earliest highlabel=latest grouporder=ascending;
MPRINT(PLOT_HORIZ_BAR_ORA_DATES):   yaxis label="";
MPRINT(PLOT_HORIZ_BAR_ORA_DATES):   run;

NOTE: PROCEDURE SGPLOT used (Total process time):
      real time           1.91 seconds
      cpu time            0.05 seconds

WARNING: GPATH or PATH is not a writable directory. It will be ignored.

View solution in original post

10 REPLIES 10
DanH_sas
SAS Super FREQ

It depends on your ODS output destination. For ODS LISTING (which would meet your needs), use the GPATH option:

 

ods listing gpath="/directory/for/image/";

 

Hope this helps!

Dan

 

DougZ
Obsidian | Level 7

Thanks Dan.  I tried that after searching some other posts in the meantime, but get this:

 

MPRINT(PLOT_HORIZ_BAR_ORA_DATES):   ** ods body="&out..png" gpath="&outdir";
MPRINT(PLOT_HORIZ_BAR_ORA_DATES):   ODS LISTING GPATH = "/lupra00a0134/temp/day/";
MPRINT(PLOT_HORIZ_BAR_ORA_DATES):   ods graphics on / imagefmt=png imagename="u01bri_data_ranges_04feb2020_is2" width=10.0in height=6.0in;
MPRINT(PLOT_HORIZ_BAR_ORA_DATES):   title "Main Oracle tables in u01bri.is2";
MPRINT(PLOT_HORIZ_BAR_ORA_DATES):   title2 "Monthly data min and max dates (as of 04feb2020)";
MPRINT(PLOT_HORIZ_BAR_ORA_DATES):   footnote2 h=5pt j=left "/lupra00a0734/usr/u022922/0_CMFPROD/trunk/sgplot/plot_horiz_bar_ora_dates.sas";
MPRINT(PLOT_HORIZ_BAR_ORA_DATES):   proc sgplot data=WORK.u01bri_data_ranges_04feb2020 noborder noautolegend;
MPRINT(PLOT_HORIZ_BAR_ORA_DATES):   where db_schema = "is2";
MPRINT(PLOT_HORIZ_BAR_ORA_DATES):   highlow y=db_table low=earliest high=latest / type=bar lowlabel=earliest highlabel=latest grouporder=ascending;
MPRINT(PLOT_HORIZ_BAR_ORA_DATES):   yaxis label="";
MPRINT(PLOT_HORIZ_BAR_ORA_DATES):   run;

NOTE: PROCEDURE SGPLOT used (Total process time):
      real time           1.91 seconds
      cpu time            0.05 seconds

WARNING: GPATH or PATH is not a writable directory. It will be ignored.
DanH_sas
SAS Super FREQ

That means that you do no have permission to write to "/lupra00a0134/temp/day". SAS cannot override the userid permissions on your Linux system.

DougZ
Obsidian | Level 7

I tested that too, I was able, under my ID (which is also how I run my SAS program from the Linux command line), to create and save a test file on that directory.  So there's something else going on here.

DanH_sas
SAS Super FREQ

How are you running your SAS program? via command line, Display Manager, or SAS Studio?

DougZ
Obsidian | Level 7

Linux command line.

DougZ
Obsidian | Level 7

I've seen that same

 

    "WARNING: GPATH or PATH is not a writable directory. It will be ignored."

 

in several of the other SGPLOT posts in this site as well.

DanH_sas
SAS Super FREQ

Try this and see if the log file is written into your directory:

 

1. Put the following in "print.sas":

    proc print data=sashelp.class; run;

 

2. run sas on the command line with the following options:

    sas -log /lupra00a0134/temp/day/print.log print.sas

 

3. See if the log file is created.

 

Let me know.

 

Thanks!

Dan

DougZ
Obsidian | Level 7

Hmmm - you solved it.  I tried running print.sas and it said,

 

. . .
-rw-rw-r-- 1 u022922 spmi   40 Feb  4 13:48 print.sas
u022922@lupra00a0734 /lupra00a0734/usr/u022922/0_CMFPROD/trunk/sgplot
$ sas -log /lupra00a0134/temp/day/print.log print.sas
ERROR: Physical file does not exist, /lupra00a0134/temp/day/print.log.
 
When I looked at it a little more closely, I realized it was a directory from another server - one we had used up until a month or so ago when we migrated to a new server, not lupra00a0134 but lupra00a0734 (and we name our directories beginning with the server name).  My SGPLOT code was left over from that earlier time and was trying to write to the former server.
 
So thanks Dan.  Hope you don't get discouraged narrowing down these big problems that turn out to be really mundane in the end  : )
DanH_sas
SAS Super FREQ

No problem :-). Glad you got it worked out.

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