[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

SAS Output to a folder

Posted on 2012-08-27
5
Medium Priority
?
2,125 Views
Last Modified: 2012-09-12
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;
0
Comment
Question by:j1981
  • 3
  • 2
5 Comments
 
LVL 14

Expert Comment

by:Aloysius Low
ID: 38339509
this is what i can think of, closest to what you would like but probably not 100%...

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.
0
 

Author Comment

by:j1981
ID: 38341056
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 ;

Open in new window


 ;*';*";*/;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         

Open in new window

0
 
LVL 14

Expert Comment

by:Aloysius Low
ID: 38341212
the output path should be a path (mount point) on the server where the SAS code is executed... it's not your local machine...
0
 

Author Comment

by:j1981
ID: 38341697
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?
0
 
LVL 14

Accepted Solution

by:
Aloysius Low earned 1500 total points
ID: 38341777
you can't set a mount point?

SAS to FTP yes - check out this link: http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000178980.htm
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
MSSQL DB-maintenance also needs implementation of multiple activities. However, unprecedented errors can hamper the database management. In that case, deploying Stellar SQL Database Toolkit ensures fast and accurate database and backup repair as wel…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question