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;
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.
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
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.
That means that you do no have permission to write to "/lupra00a0134/temp/day". SAS cannot override the userid permissions on your Linux system.
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.
How are you running your SAS program? via command line, Display Manager, or SAS Studio?
Linux command line.
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.
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
Hmmm - you solved it. I tried running print.sas and it said,
No problem :-). Glad you got it worked out.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.