09-01-2015
Dorota_Jarosz
Obsidian | Level 7
Member since
06-23-2011
- 66 Posts
- 17 Likes Given
- 0 Solutions
- 21 Likes Received
-
Latest posts by Dorota_Jarosz
Subject Views Posted 1674 07-30-2012 06:21 PM 1358 07-27-2012 05:32 PM 120715 07-26-2012 05:21 PM 1154 07-26-2012 05:00 PM 11269 07-26-2012 03:59 PM 1261 07-26-2012 12:37 AM 2929 07-25-2012 01:28 PM 1211 07-25-2012 12:40 PM 2928 07-25-2012 12:35 PM 2929 07-25-2012 11:48 AM -
Activity Feed for Dorota_Jarosz
- Got a Like for Re: How to change the datetime format to date9. in a SAS data set imported from MS Excel?. 11-14-2019 08:34 AM
- Got a Like for Re: Convert HH:MM to days hours and minutes. 11-12-2019 08:51 AM
- Got a Like for Re: Convert HH:MM to days hours and minutes. 02-16-2018 02:55 AM
- Got a Like for Re: Renaming attributes in a user friendly manner. 09-01-2015 04:24 AM
- Got a Like for Re: ODBC engine not found in 9.3 with dual ver 9.3 and 9.2 PC installations. 09-01-2015 04:24 AM
- Got a Like for Re: Summing values based on days in separate column. 09-01-2015 04:24 AM
- Got a Like for Re: Standard deviation or error [SURVEYMEANS and SURVEYFREQ]. 09-01-2015 04:24 AM
- Got a Like for Re: GPlot: Move title closer to graph?. 10-20-2012 01:06 PM
- Liked Re: how to add rows when there is missing obs. for PaulLee. 10-04-2012 02:52 PM
- Liked Re: Error Message for Rick_SAS. 10-04-2012 12:48 PM
- Liked Re: regression line in proc gplot for PaigeMiller. 10-04-2012 10:44 AM
- Posted Re: error stored process on ODS and Base Reporting. 07-30-2012 06:21 PM
- Posted Re: Renaming attributes in a user friendly manner on SAS Enterprise Guide. 07-27-2012 05:32 PM
- Liked Re: Help with grouping for art297. 07-27-2012 01:01 PM
- Liked Re: How to change the datetime format to date9. in a SAS data set imported from MS Excel? for Ksharp. 07-27-2012 11:30 AM
- Liked Re: how to divide dataset into 3 samples,each one with 50% males & females for Reeza. 07-26-2012 06:20 PM
- Posted Re: How to change the datetime format to date9. in a SAS data set imported from MS Excel? on SAS Procedures. 07-26-2012 05:21 PM
- Posted Re: Need help in modifying the sas code on SAS Programming. 07-26-2012 05:00 PM
- Posted Re: how to divide dataset into 3 samples,each one with 50% males & females on Statistical Procedures. 07-26-2012 03:59 PM
- Posted Re: proc means output on SAS Procedures. 07-26-2012 12:37 AM
-
Posts I Liked
Subject Likes Author Latest Post 1 1 1 2 6 -
My Liked Posts
Subject Likes Posted 1 07-26-2012 05:21 PM 3 07-19-2012 04:13 PM 3 07-19-2012 12:38 PM 3 07-24-2012 04:03 PM 3 07-24-2012 07:32 PM
07-30-2012
06:21 PM
Even though it looks like a non-Windows system, the path to the STP directory is awfully long (121 characters): (/opt/app/SAS/work/SAS_work87D2000036D6_esessux0015/SAS_work8E07000036D6_esessux0015/7e539000-ab52-11e1-8001-313430333831/) I know for a fact that copying SAS software depot into Myfiles directory or into Desktop, causes PC SAS installation process to fail. I don't know how your STP directory gets assigned and whether this is relevant at all in your case, but if you have any input into this assignment, try shortening this path.
... View more
07-27-2012
05:32 PM
What is your LIB library? Is it defined using the ODBC engine? Perhaps it has something to do with the problem reported in this SAS note for Access to Oracle: SAS/ACCESS ® software's LIBNAME engines support creating tables as well as reading from and writing to tables, but they do not support table altering. http://support.sas.com/kb/37/015.html
... View more
07-26-2012
05:21 PM
1 Like
Mirisage, A datetime variable stores time in SECONDS since midnight of January 1, 1960. A date variable stores number of DAYS since January 1, 1960. If you want the date rather than datetime, you must divide the numerical value by (24*60*60) or '24:00't. If there exists a time part of the datetime variable, you can extract the date by using the datepart() function or by using the integer part of the division result: int(post_date/(24*60*60)). If you want the time part then you need the remainder from the division by 24 hours. I hope this helps, Dorota
... View more
07-26-2012
05:00 PM
Hi Neetu, I think you wanted the days to be on the X axis and finish time on the Y axis. If not, you need to swap the order in the plot statement. You can comment out the goptions changing the size of the chart, font, etc. I had to generate some data. Try this code whether it works for you. data a; format finish_time TIMEAMPM11. dy ddmmyy8.; finish_time='04:55:23't; do dy='18JUL12'd to '25JUL12'd by 1; finish_time=finish_time 120*ranuni(0) + 10*ranuni(0); output; end; run; options nocenter nodate byline; goptions reset=all ftext="Albany AMT" htext=0.35cm ctext=BLACK fontres=presentation border vsize=4.2in hsize=7.5in noprompt NOGSFPROMPT; SYMBOL1 INTERPOL=JOIN HEIGHT=10pt VALUE=NONE LINE=1 WIDTH=2 CV = _STYLE_; Axis1 STYLE=1 WIDTH=1 MINOR=NONE LABEL=( "TIME" ); Axis2 STYLE=1 WIDTH=1 MINOR=NONE LABEL=( "DATE" ); TITLE; TITLE2 "Line Plot"; PROC GPLOT DATA = a; PLOT finish_time*dy / VAXIS=AXIS1 HAXIS=AXIS2 FRAME; RUN; QUIT; TITLE2; FOOTNOTE; GOPTIONS RESET = all; Each time you generate a plot it is appended to the gseg catalog as Gplot, Gplot1, Gplot2, Gplot3, etc.. You must press page Down to see the last chart. When you want to delete all old plots and start from scratch, submit the following code: /* delete previously created grsegs before creating new ones */ proc greplay igout=work.gseg nofs; delete _all_; run; quit;
... View more
07-26-2012
03:59 PM
Try METHOD=PPS in the procedure statement options, as described in SAS documentation: http://support.sas.com/documentation/cdl/en/statug/63962/HTML/default/viewer.htm#statug_surveyselect_sect007.htm This is what comes first when searching by keywords "surveyselect without replacement."
... View more
07-26-2012
12:37 AM
Thank you, MIke. I really like your solution. My mind is still in the mainframe and flat file mode.
... View more
07-25-2012
01:28 PM
Hi Shri, If you did not find a correct answer here is one more tip: data have2; format f1 f2 $30. fn1 8.2 fn2 tot tot2 8.2 ; input f1 1-11 f2 12-22; fn1=input(substr(f1,1,length(compress(f1))),best8.); fn2=input(substr(f2,1,length(compress(f2))),best8.); tot=sum(0,fn1,fn2); * if you have many fni columns you may use an array instead; array f {*} fn1 -- fn2; tot2=0; do i=1 to dim(f); tot2=sum(0,tot2,f); end; drop i; cards; 1 229.00 2 39.83 3 38.25 4 1 346.00 26.75 1 55.64 ; run; options nocenter; proc print; run; *Output: Obs fn1 fn2 tot tot2 1 1.00 229.00 230.00 230.00 2 2.00 39.83 41.83 41.83 3 3.00 38.25 41.25 41.25 4 4.00 . 4.00 4.00 5 1.00 346.00 347.00 347.00 6 . 26.75 26.75 26.75 7 1.00 55.64 56.64 56.64 8 . . 0.00 0.00 ; Hope this helps, Dorota
... View more
07-25-2012
12:40 PM
Read this SAS Note: http://support.sas.com/kb/17/008.html or an expanded tutorial here: SAS programming guide, sas error, Catalog SASHelp.Dmine does not exist Hope this helps, Dorota Message was edited by: Dorota Jarosz - added a link to expanded tutorial
... View more
07-25-2012
12:35 PM
Shri, (actually this was an attempt to answer RV's question) I am getting an error with the length-1 third argument and I should. What is even more odd, I am getting single digit hundredths values rather than integers. I guess I have to study the input function :smileyshocked: data have; format f1 f2 $30. f1n 8.2 f2n 8.2 ; input f1 1-11 f2 12-22; f1n=input(substr(f1,1,length(trim(f1))),8.2); f2n=input(substr(f2,1,length(trim(f2))),8.2); cards; 1 229.00 2 39.83 3 38.25 1 346.00 1 55.64 ; run; options nocenter; proc print; run; *Output: f1n values in decimals? Obs f1 f2 f1n f2n 1 1 229.00 0.01 229.00 2 2 39.83 0.02 39.83 3 3 38.25 0.03 38.25 4 1 346.00 0.01 346.00 5 1 55.64 0.01 55.64 ; data have2; format f1 f2 $30. f1n 8.2 f2n 8.2 ; input f1 1-11 f2 12-22; f1n=input(substr(f1,1,length(compress(f1))),best8.); f2n=input(substr(f2,1,length(compress(f2))),best8.); cards; 1 229.00 2 39.83 3 38.25 1 346.00 1 55.64 ; run; options nocenter; proc print; run; *Output: Obs f1 f2 f1n f2n 1 1 229.00 1.00 229.00 2 2 39.83 2.00 39.83 3 3 38.25 3.00 38.25 4 1 346.00 1.00 346.00 5 1 55.64 1.00 55.64 ; Message was edited by: Dorota Jarosz - added (actually this was an attempt to answer RV's question) to the greetings.
... View more
07-25-2012
11:48 AM
To make your input function flexible, use the length function as the second parameter: f1n = input(substr(f1,1,length(f1),8.2); Please provide more info. How are you importing the csv file? Do you use the missover option in the filename statement?
... View more
07-25-2012
11:15 AM
SAS assigns the best16. format, if none is specified. Try adding a format statement for the new variables. format f1n f2n 8.2; f1n=sum(0,input(f1,8.2); By the way, do you really need the character variables to be 30 characters long? Unless you know you have very long strings (which are supposed to be numbers anyway), you should make these fields shorter.
... View more
07-24-2012
09:48 PM
Expanding on Linlin's ideas and assuming SAS version 9.1 and no SAS/Access to PC Files: proc means data = sashelp.class noprint; var age ; OUTPUT OUT=dat1 (drop=_:) q1=q1 q3=q3 qrange=qrange ; run; proc means data = sashelp.class noprint; var height ; OUTPUT OUT=dat2 (drop=_:) q1=q1 q3=q3 qrange=qrange ; run; proc means data = sashelp.class noprint; var weight ; OUTPUT OUT=dat3 (drop=_:) q1=q1 q3=q3 qrange=qrange ; run; data want; length item $ 10; set dat1; item="age"; output; set dat2; item="height"; output; set dat3; item="weight"; output; run; proc print;run; *output: Obs item q1 q3 qrange 1 age 12.0 15.0 3 2 height 57.5 66.5 9 3 weight 84.0 112.5 28.5 ; *old fashion CSV output to flat file; filename csv "C:\temp\Quartiles.csv"; data _null_; set want; file csv; if _n_=1 then put @1 "Variable," @12 "q1," @22 "q3," @32 "qrange" ; put @1 item "," @12 q1 best8. "," @22 q3 best8. "," @32 qrange best8. ; run;
... View more
07-24-2012
07:32 PM
3 Likes
Proc surveymeans outputs the mean, st.error, and confidence limits for the mean by default. If you are requesting other statistcs, you need to provide the specific syntax and options you are using. The interpretation of the output may depend on the position of the option in the procedure syntax. Proc statement options, Ratio statement options, etc. Standard error is the estimate of standard deviation of the estimator of the statistic in question, based on the given sample size. So yes, the confidence limits for the statistic (e.g., the mean) will be based on this standard error. Standard deviation is usually referring to the variation of the original variable raw values in the population, not the variation of a statistic from the sample with a fixed sample size.
... View more
07-24-2012
06:43 PM
This is also true for independent Windows workstation SAS installation trying to connect to an ODBC system database. We had to add servers to tnsnames.ora file on each PC. We also had to define this system database in Windows Data Sources (ODBC) tool.
... View more
07-24-2012
06:25 PM
Hi Zetter, You can output the results of proc freq to a dataset, one table at a time. The categorization of the library visits variable can be accomplished either by hard coding or by assigning a user defined format. The following two proc freq steps produce the same output: proc freq data=library noprint; tables behaviour*lib_vis_cat /out=beh_vis_cat (drop=percent); *title "Behaviour by Library visit count - hard coded"; run; proc format; value lib_vis_fmt low-9 = " 1-9" 10-20 = "10-20" 21-30 = "21-30" 31-high="31 plus"; run; proc freq data=library noprint; tables behaviour*lib_visits / out=beh_vis (drop=percent) ; *title "Behaviour by Library visit count using format"; format lib_visits lib_vis_fmt.; run; *Both tables contain four variables: behaviour, lib_visits (or lib_vis_cat), COUNT, and PERCENT, which can be dropped using the output data set option shown. You can use this syntax for any variable in the data set, but if you include more than one cross tabultion in the tables statement, only the last one will be output.; proc print data=beh_vis noobs; title "Behaviour by library visit count using format"; run; *Output: Behaviour by library visit count using format lib_ behaviour visits COUNT bad 1-9 3 bad 10-20 2 bad 31 plus 1 good 1-9 3 good 10-20 2 good 31 plus 1 nice 1-9 1 nice 21-30 3 ;
... View more