j1981
asked on
SAS Output to a folder
Hi, I have the following working code. I wanted to modify this so that the charts can be saved into a local drive or network drive. Help would be greatly appreciated.
Data metric;
input week$ metricvalue;
cards;
W1 0.532897493793547
W2 0.521608118027491
W3 0.512487447972491
W4 0.525002111361488
W5 0.557680307803465
W6 0.548129188341814
W7 0.560015315955464
W8 0.536143287978799
W9 0.530001779044326
W10 0.524230741257976
W11 0.534905631429207
W12 0.529500177114168
W13 0.540122521437269
W14 0.555478746849369
W15 0.589616730403663
;
run;
PROC SHEWHART DATA = metric
;
IRCHART (metricvalue) * week /
SIGMAS=3
CAXIS=BLACK
WAXIS=1
CTEXT=BLACK
CINFILL=CXA9A9A9
CLIMITS=BLACK
TOTPANELS=1
CCONNECT=BLUE
COUT=RED
COUTFILL=RED
CFRAME=CXD3D3D3
LIMITN=2
;
RUN; QUIT;
Data metric;
input week$ metricvalue;
cards;
W1 0.532897493793547
W2 0.521608118027491
W3 0.512487447972491
W4 0.525002111361488
W5 0.557680307803465
W6 0.548129188341814
W7 0.560015315955464
W8 0.536143287978799
W9 0.530001779044326
W10 0.524230741257976
W11 0.534905631429207
W12 0.529500177114168
W13 0.540122521437269
W14 0.555478746849369
W15 0.589616730403663
;
run;
PROC SHEWHART DATA = metric
;
IRCHART (metricvalue) * week /
SIGMAS=3
CAXIS=BLACK
WAXIS=1
CTEXT=BLACK
CINFILL=CXA9A9A9
CLIMITS=BLACK
TOTPANELS=1
CCONNECT=BLUE
COUT=RED
COUTFILL=RED
CFRAME=CXD3D3D3
LIMITN=2
;
RUN; QUIT;
ASKER
I modified the code as below and it threw an error. The log is below the code. It seems to be a Unix-Windows access issue.
Data metric;
input week$ metricvalue;
cards;
W1 0.532897493793547
W2 0.521608118027491
W3 0.512487447972491
W4 0.525002111361488
W5 0.557680307803465
W6 0.548129188341814
W7 0.560015315955464
W8 0.536143287978799
W9 0.530001779044326
W10 0.524230741257976
W11 0.534905631429207
W12 0.529500177114168
W13 0.540122521437269
W14 0.555478746849369
W15 0.589616730403663
;
run;
ODS HTML PATH="C:/Test";
PROC SHEWHART DATA = metric
;
IRCHART (metricvalue) * week /
SIGMAS=3
CAXIS=BLACK
WAXIS=1
CTEXT=BLACK
CINFILL=CXA9A9A9
CLIMITS=BLACK
TOTPANELS=1
CCONNECT=BLUE
COUT=RED
COUTFILL=RED
CFRAME=CXD3D3D3
LIMITN=2
;
RUN; QUIT;
ODS HTML close ;
;*';*";*/;quit;run;
2 OPTIONS PAGENO=MIN;
3 %LET _CLIENTTASKLABEL='ControlChartWorking code';
4 %LET _CLIENTPROJECTPATH='\\ttcfile04\*****************\ ! *******************\Multiple metrics control
4 ! charting_22_Aug.egp';
5 %LET _CLIENTPROJECTNAME='Multiple metrics control charting_22_Aug.egp';
6 %LET _SASPROGRAMFILE=;
7
8 ODS _ALL_ CLOSE;
9 OPTIONS DEV=ACTIVEX;
10 GOPTIONS XPIXELS=0 YPIXELS=0;
11 FILENAME EGSR TEMP;
12 ODS tagsets.sasreport12(ID=EGSR) FILE=EGSR STYLE=Analysis
12 ! STYLESHEET=(URL="file:///C:/Program%20Files/SAS92/EnterpriseGuide/4.3/Styles/Analysis.css") NOGTITLE NOGFOOTNOTE
12 ! GPATH=&sasworklocation ENCODING=UTF8 options(rolap="on");
NOTE: Writing TAGSETS.SASREPORT12(EGSR) Body file: EGSR
13
14 GOPTIONS ACCESSIBLE;
15
16
17
18
19
20 Data metric;
21 input week$ metricvalue;
22 cards;
NOTE: SAS went to a new line when INPUT statement reached past the end of a line.
NOTE: The data set WORK.METRIC has 15 observations and 2 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
39 ;
40 run;
41
42 ODS HTML PATH="C:/Test";
NOTE: Writing HTML Body file: sashtml1.htm
ERROR: Physical file does not exist, /apps/sas/Config/SAS_93/CONFIG/Lev1/SASApp/C:/Test/sashtml1.htm.
ERROR: No body file. HTML output will not be created.
43
44
45 PROC SHEWHART DATA = metric
46 ;
47 IRCHART (metricvalue) * week /
48
49 SIGMAS=3
50 CAXIS=BLACK
51 WAXIS=1
52 CTEXT=BLACK
53 CINFILL=CXA9A9A9
54 CLIMITS=BLACK
55 TOTPANELS=1
56 CCONNECT=BLUE
57 COUT=RED
58 COUTFILL=RED
2 The SAS System 08:48 Tuesday, August 28, 2012
59 CFRAME=CXD3D3D3
60 LIMITN=2
61 ;
62
63 RUN;
NOTE: Processing beginning for IRCHART statement number 1.
NOTE: TYPE=ESTIMATE is assumed for the process mean and standard deviation used to compute the control limits.
NOTE: For process variable metricvalue moving ranges are based on 2 consecutive values.
ERROR: Insufficient authorization to access /apps/sas/Config/SAS_93/CONFIG/Lev1/SASApp/C:\Test.
ERROR: Unable to initialize graphics device.
NOTE: There were 15 observations read from the data set WORK.METRIC.
NOTE: PROCEDURE SHEWHART used (Total process time):
real time 0.11 seconds
cpu time 0.02 seconds
63 ! QUIT;
64
65 ODS HTML close ;
66
67
68 GOPTIONS NOACCESSIBLE;
69 %LET _CLIENTTASKLABEL=;
70 %LET _CLIENTPROJECTPATH=;
71 %LET _CLIENTPROJECTNAME=;
72 %LET _SASPROGRAMFILE=;
73
74 ;*';*";*/;quit;run;
75 ODS _ALL_ CLOSE;
76
77
78 QUIT; RUN;
79
the output path should be a path (mount point) on the server where the SAS code is executed... it's not your local machine...
ASKER
i think if that is the only option, then I will have to FTP files to a network drive. Does SAS have any utility/built in functions to FTP files?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
enclose your proc shewhart .... run; quit; statement with ODS:
ODS HTML PATH="[your desired path]";
PROC SHEWHART ...
....
....
....
RUN; QUIT;
ODS CLOSE HTML;
when you go to your desired path, you'll find:
the chart and the html.. my chart is named IRChart[x].png and HTML sashtml[x].htm where X is the number of times i have executed the command... this means that the file will get overwritten each time it's executed...
like i said, it's not 100%, but at least you get your graph output somewhere per your requirement.