09-01-2015
Howles
Quartz | Level 8
Member since
06-23-2011
- 184 Posts
- 0 Likes Given
- 0 Solutions
- 60 Likes Received
-
Latest posts by Howles
Subject Views Posted 1363 05-25-2015 05:06 PM 3906 04-07-2015 09:57 PM 1286 02-24-2015 09:22 PM 1524 02-19-2015 11:08 AM 13407 02-11-2015 05:12 PM 15810 02-05-2015 03:09 PM 1739 02-04-2015 05:40 PM 1525 02-04-2015 05:20 PM 1243 01-28-2015 05:11 PM 5916 01-23-2015 01:26 PM -
Activity Feed for Howles
- Got a Like for Re: Sort ascending with missing values. 06-21-2024 06:37 PM
- Got a Like for Re: how to insert a new colomn into dataset use proc sql?. 10-28-2022 05:37 PM
- Got a Like for Re: converting numbers to time format?. 12-16-2021 09:12 AM
- Got a Like for Re: Concatenate multiple rows into a single value. 02-04-2021 10:41 AM
- Got a Like for Re: Use RETAIN to re-order variables. 08-18-2020 01:00 PM
- Got a Like for date diff SQL to Sas. 06-14-2020 09:23 AM
- Got a Like for UPCASE ALL VARIABLES IN DATASET. 04-26-2018 03:13 AM
- Got a Like for Re: converting numbers to time format?. 03-06-2018 02:32 PM
- Got a Like for Re: Concatenate multiple rows into a single value. 10-04-2017 07:37 AM
- Got a Like for Re: Concatenate multiple rows into a single value. 03-21-2017 03:35 PM
- Got a Like for Re: Change case of variable name. 02-21-2017 10:56 AM
- Got a Like for Re: Concatenate multiple rows into a single value. 01-26-2017 07:44 AM
- Got a Like for Re: Concatenate multiple rows into a single value. 01-13-2016 12:41 PM
- Got a Like for How to keep an index in a dataset. 09-01-2015 04:24 AM
- Got a Like for Re: Run SQL statements stored in a variable. 09-01-2015 04:24 AM
- Got a Like for Please help to convert Rows to Columns.... 09-01-2015 04:24 AM
- Got a Like for joing tables using PROC SQL. 09-01-2015 04:24 AM
- Got a Like for When I delete a post, are all the posts following my post also deleted?. 09-01-2015 04:24 AM
- Got a Like for Re: how to subset observations based on id if they exist for all years.... NEED HELP. 09-01-2015 04:24 AM
- Got a Like for Re: How to make use of a variable in array definition. 09-01-2015 04:24 AM
-
My Liked Posts
Subject Likes Posted 2 06-01-2012 05:07 PM 1 09-22-2012 12:08 PM 1 06-24-2011 06:26 PM 1 01-13-2012 05:07 PM 2 10-30-2014 06:08 PM
05-25-2015
05:06 PM
The lengths of the variables (especially character variables) are also an issue. So run PROC CONTENTS for each data set created.
... View more
04-07-2015
09:57 PM
UPDATE, or MODIFY??
... View more
02-19-2015
11:08 AM
05/01/2010 is not a valid date literal, but it is a valid numeric expression. ( (5/1)/2010 ) evaluates to 0.0024875, which interprets as 1 January 1960.
... View more
02-11-2015
05:12 PM
1 Like
CASE is meant for this. PROC SQL; CREATE TABLE summary AS SELECT AVG( case when (c=0) then b else (.) end ) AS Mean_B_C0, AVG( case when (c=1) then b else (.) end ) AS Mean_B_C1 FROM data; QUIT;
... View more
02-04-2015
05:40 PM
1 Like
Try something like this. proc format ; invalue none_zero 'None' = 0 other = [12.] ; run ; data _null_ ; input val none_zero. ; put val= ; cards; 123 None ;
... View more
02-04-2015
05:20 PM
1 Like
The original difficulty arises because the VALUE statement requires literals (not expressions). But the specs change only from one launch of the program to the next (not on the fly within the program). So %sysfunc and %eval offer a workaround. Try something like this: Proc Format; %let td = %sysfunc( today() ) ; %let wd = %sysfunc( weekday(&td.)) ; value week %eval(&td.-&wd.- 7) -< %eval(&td.-&wd. ) = week1 %eval(&td.-&wd.-14) -< %eval(&td.-&wd.- 7) = week2 ; %symdel td wd ; run;
... View more
01-28-2015
05:11 PM
Go to Macro Collections - sasCommunity and follow Mayo Clinic link.
... View more
01-23-2015
01:26 PM
Actually that difference is 41972 1 data _null_ ; 2 days_between = '01dec2014'd - '01jan1900'd ; 3 put days_between= ; 4 run ; days_between=41972
... View more
12-26-2014
09:55 PM
Why (not) generate code with a macro? But first, make sure the target code is right. Why the ALLs in the UNIONs?
... View more
12-26-2014
09:46 PM
1. The (self-anointed) Macro Maven is Ron Fehd, not Ian Whitlock. 2. I would not dismiss the available user-written books about the macro facility.
... View more
12-22-2014
12:16 PM
See Convert Numeric Variables to Character - sasCommunity However, the technique might be defeated by the sheer number of columns.
... View more
12-17-2014
04:32 PM
What I don't know is how the SQL statement is optimized by PROC SQL. Maybe the SELECT is evaluated and the result set is spooled somewhere. Then the rows are batch-inserted into the target table. That seems to be the original poster's theory. Maybe the SELECT is evaluated and as each row is generated it triggers a single-row insertion operation. That's my hunch. The results will of course be the same either way, but the incurrence of overhead could differ.
... View more
12-14-2014
11:00 AM
I observe SQL defaulting to BEST8. The DATA step language uses BEST12. Try this: data demo ; numvar = constant('pi') ; put numvar ; run ; proc sql noprint ; select numvar into : macrovar from demo ; %put ¯ovar ; quit ;
... View more