BookmarkSubscribeRSS Feed
George4
Calcite | Level 5

I am using the stored process server to generate a html report including a chart produced with proc sgplot, and am encountering a Physical file does not exist error  in my log which I'd like to fix.  The weird thing is that the page generated by the stored process server displays fine in the browser including the image generated by proc sgplot.   Platform details below

 

NOTE: Copyright (c) 2002-2012 by SAS Institute Inc., Cary, NC, USA. 
NOTE: SAS (r) Proprietary Software 9.4 (TS1M3) 
NOTE: This session is executing on the Linux 2.6.32-754.9.1.el6.x86_64 (LIN X64) platform.

NOTE: Additional host information:

 Linux LIN X64 2.6.32-754.9.1.el6.x86_64 #1 SMP Wed Nov 21 15:08:21 EST 2018 x86_64 Red Hat Enterprise Linux Server release 6.10 (Santiago) 

The stored process looks like the below

*processbody;
%stpbegin;

ods graphics on / imagemap=on;
ods graphics / width=14in height=6in tipmax=2800;
ods layout gridded columns=1  width=15in column_gutter=0.1in row_gutter=0.1in advance=table;

ods trace on / label;

/*Weights Chart*/
data _annotation_wgt;
length function $ 8 anchor $ 5;
    function="text";
    label="&mydisplayname Weights";
    textstyleelement="GraphTitleText";
    textcolor="black";
    width=100;
    anchor="top";
    y1=100;
    drawspace="GraphPercent";
output;
run;

proc sgplot data=wgtdata
            sganno=_annotation_wgt pad=(top=25px);
series x=thedt y=wgt / group=model_name lineattrs=(thickness=2) tip=(model_name wgt);
yaxis grid label="Weight";
run;

ods layout end;
ods graphics / reset;

%stpend;

which apparently runs and displays ok in the browser, but the log looks like the below

60        +*processbody;
61        +%stpbegin;
MPRINT(STPBEGIN):   options nonotes;
MPRINT(STPBEGIN):   ods listing close;
MPRINT(STPBEGIN):   ods HTML nogtitle nogfootnote body=_WEBOUT path=SAVE.TMPCAT (url="/SASStoredProcess/do?_sessionid=97DCBD4E-AD31-E045-87EA-9BAE9A23ADFF&_program=replay&_entry=SAVE.TMPCAT.")
CHARSET=' ' ;
MPRINT(STPBEGIN):   options device=javaimg;
MPRINT(STPBEGIN):   options NOTES;
62        +
63        +ods graphics on / imagemap=on;
64        +ods graphics / width=14in height=6in tipmax=2800;
65        +ods layout gridded columns=1  width=15in column_gutter=0.1in row_gutter=0.1in advance=table;
66        +
67        +ods trace on / label;
68        +
69        +/*Weights Chart*/
70        +data _annotation_wgt;
71        +length function $ 8 anchor $ 5;
72        +    function="text";
^L                                                                                          The SAS System

73        +    label="&mydisplayname Weights";
74        +    textstyleelement="GraphTitleText";
75        +    textcolor="black";
76        +    width=100;
77        +    anchor="top";
78        +    y1=100;
79        +    drawspace="GraphPercent";
80        +output;
81        +run;

NOTE: The data set WORK._ANNOTATION_WGT has 1 observations and 8 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds


82        +
83        +proc sgplot data=wgtdata
84        +            sganno=_annotation_wgt pad=(top=25px);
85        +series x=thedt y=wgt / group=model_name lineattrs=(thickness=2) tip=(model_name wgt);
86        +yaxis grid label="Weight";
87        +run;

NOTE: PROCEDURE SGPLOT used (Total process time):
      real time           0.48 seconds
      cpu time            0.20 seconds


Output Added:
-------------
Name:       SGPlot
Label:      The SGPlot Procedure
Data Label: SGPlot
Path:       SGPlot.SGPlot
Label Path: 'The SGPlot Procedure'.'The SGPlot Procedure'
-------------
NOTE: The column format DATETIME16 is replaced by an auto-generated format on the axis.
ERROR: Physical file does not exist, /app/sas/config/Lev3/SASApp/SGPlot.png.
^L                                                                                          The SAS System

NOTE: There were 1152 observations read from the data set WORK.WGTDATA.

88        +
89        +ods layout end;
90        +ods graphics / reset;
91        +
92        +%stpend;
MPRINT(STPEND):   options nonotes;
MPRINT(STPEND):   ods _ALL_ close;
MPRINT(STPEND):   options NOTES;
93        +
NOTE: %INCLUDE (level 2) ending.
NOTE: %INCLUDE (level 1) resuming.
94        +
NOTE: %INCLUDE (level 1) ending.

 Now the stored process user does not have permission to write to /app/sas/config/Lev3/SASApp/ so it being unable to create SGPlot.png in that location would be quite reasonable, but why / what is it trying to write into / read from that location which seems to be unrelated to the line generated in the HTML source (which renders correctly)

<img alt="The SGPlot Procedure" src="/SASStoredProcess/do?_sessionid=97DCBD4E-AD31-E045-87EA-9BAE9A23ADFF&_program=replay&_entry=SAVE.TMPCAT.SGPlot.png" style=" height: 576px; width: 1344px;" border="0" usemap="#SGPlot" class="c">

Any suggestions as to the best way to solve this error (whilst keeping the html rendering correctly) would be much appreciated

4 REPLIES 4
DWilson
Pyrite | Level 9

If you want to save your plot do this:

 

ODS LISTING GPATH="directory you can write to";

 

at the beginning of your program

 

Other approaches:

 

http://support.sas.com/kb/49/421.html

 

 

George4
Calcite | Level 5

Thanks for the suggestions, unfortunately they don't seem to have done anything to shift the error,

adding an ODS LISTING line doesn't remove the error message from my log.  Note that ods listing is explicitly closed by the %stpbegin macro, anyway I reopened it and set the gpath to the pathname of the work directory.   With ods listing open I get the below written into my log

 

ERROR: Physical file does not exist, /app/sas/config/Lev3/SASApp/SGPlot.png.
NOTE: Listing image output written to /data/saswork1/SAS_work3B8400007F74_sl07377.e-ssi.net/SAS_work4EDA00007F74_sl07377.e-ssi.net/SGPlot1.png

 

I also tried moving the ods listing gpath= line to before the %STPBEGIN in case having gpath set prior to %STPBEGIN being resolved is important, but that didn't help either.

The KB article didn't help me, essentially it says to close the ods listing destination or to open the ods html destination using the path attribute (both of which appear to be being done by %STPBEGIN according to my log).

 

Any more ideas. 

 

 

 

DWilson
Pyrite | Level 9

@George4 wrote:

Thanks for the suggestions, unfortunately they don't seem to have done anything to shift the error,

adding an ODS LISTING line doesn't remove the error message from my log.  Note that ods listing is explicitly closed by the %stpbegin macro, anyway I reopened it and set the gpath to the pathname of the work directory.   With ods listing open I get the below written into my log

 

ERROR: Physical file does not exist, /app/sas/config/Lev3/SASApp/SGPlot.png.
NOTE: Listing image output written to /data/saswork1/SAS_work3B8400007F74_sl07377.e-ssi.net/SAS_work4EDA00007F74_sl07377.e-ssi.net/SGPlot1.png

 

I also tried moving the ods listing gpath= line to before the %STPBEGIN in case having gpath set prior to %STPBEGIN being resolved is important, but that didn't help either.

The KB article didn't help me, essentially it says to close the ods listing destination or to open the ods html destination using the path attribute (both of which appear to be being done by %STPBEGIN according to my log).

 

Any more ideas. 

 

 

 


Turn off ODS listing and try specifying a specific directory (where you know you have write access) to store the PNG file using the GPATH option on the ODS HTML statement.

 

Tom
Super User Tom
Super User

Why does your ODS HTML statement point PATH to SAS object instead of an actual path?

MPRINT(STPBEGIN):   ods HTML nogtitle nogfootnote
 body=_WEBOUT
 path=SAVE.TMPCAT
 (url="/SASStoredProcess/do?_sessionid=97DCBD4E-AD31-E045-87EA-9BAE9A23ADFF&_program=replay&_entry=SAVE.TMPCAT.")
 CHARSET=' ' 
;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 4 replies
  • 1147 views
  • 0 likes
  • 3 in conversation