02-27-2018
Data_User
Quartz | Level 8
Member since
02-10-2017
- 46 Posts
- 16 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by Data_User
Subject Views Posted 3986 01-05-2018 09:32 AM 4032 01-05-2018 07:28 AM 4040 01-05-2018 07:16 AM 2289 07-13-2017 06:05 AM 3186 06-27-2017 10:14 AM 3188 06-27-2017 10:13 AM 3241 06-27-2017 06:27 AM 1515 06-26-2017 09:23 AM 1518 06-26-2017 09:22 AM 1555 06-26-2017 08:45 AM -
Activity Feed for Data_User
- Posted Re: Months Difference between two dates with exact figures including decimals on SAS Enterprise Guide. 01-05-2018 09:32 AM
- Posted Re: Months Difference between two dates with exact figures including decimals on SAS Enterprise Guide. 01-05-2018 07:28 AM
- Posted Months Difference between two dates with exact figures including decimals on SAS Enterprise Guide. 01-05-2018 07:16 AM
- Posted Converting SQL Code to SAS on SAS Programming. 07-13-2017 06:05 AM
- Liked Re: Moving observations in the required position for Astounding. 06-27-2017 10:15 AM
- Posted Re: Moving observations in the required position on SAS Programming. 06-27-2017 10:14 AM
- Liked Re: Moving observations in the required position for RW9. 06-27-2017 10:14 AM
- Posted Re: Moving observations in the required position on SAS Programming. 06-27-2017 10:13 AM
- Liked Re: Moving observations in the required position for Kurt_Bremser. 06-27-2017 10:12 AM
- Liked Re: Moving observations in the required position for slchen. 06-27-2017 10:12 AM
- Posted Moving observations in the required position on SAS Programming. 06-27-2017 06:27 AM
- Posted Re: Ordering without sorting on SAS Programming. 06-26-2017 09:23 AM
- Posted Re: Ordering without sorting on SAS Programming. 06-26-2017 09:22 AM
- Liked Re: Ordering without sorting for Astounding. 06-26-2017 09:21 AM
- Posted Ordering without sorting on SAS Programming. 06-26-2017 08:45 AM
- Posted Re: Reading Tab delimited file with non standard data on SAS Programming. 06-17-2017 06:43 PM
- Liked Re: Reading Tab delimited file with non standard data for Tom. 06-17-2017 06:41 PM
- Posted Re: Reading Tab delimited file with non standard data on SAS Programming. 06-17-2017 05:46 PM
- Liked Re: Reading Tab delimited file with non standard data for SuzanneDorinski. 06-17-2017 05:46 PM
- Posted Re: Reading Tab delimited file with non standard data on SAS Programming. 06-17-2017 05:32 PM
-
Posts I Liked
Subject Likes Author Latest Post 1 1 2 1 3
01-05-2018
09:32 AM
Thank you all!
... View more
01-05-2018
07:28 AM
Expecting the results as follows: Date1 Date2 Difference in months 28-Mar-08 20-Oct-05 29.25806452 20-Jun-11 11-Mar-09 27.29032258 24-Aug-06 23-Feb-06 6.032258065
... View more
01-05-2018
07:16 AM
Hi, Is there a way to get the exact difference in months with decimals between two dates in SAS? data want; input date1='01Jan2017'd; date2='01Jan2018'd; months1=(date2-date1)/(365.25/12); run; I have the above method, but not sure it's gives the accurate results...
... View more
07-13-2017
06:05 AM
Hi, Is there a way to convert the below code to work in SAS? Specifically I am looking for alternative options for "decode", "sign", "to_number" & "to_char" functions used in the below code. Any help on this is highly appreciated. proc sql; create table test1 as select a.var1, count(c.var2) as var2 format=comma20.2, sum(c.var3) as var3 format=comma20.2, sum(a.var4) as var4 format=comma20.2, decode( c.var5,14,a.var6, decode( sign(to_number( to_char( d.var7,'yyyymmdd') )),2,500, a.var6)) from db.table1 as a, db.table2 as b, db.table3 as c, db.table4 as d where a.key1 = d.key1 and b.key2 = a.key2 and a.key3 = c.key3 and b.date is null group by a.var1, decode( c.var5,14,a.var6, decode( sign(to_number( to_char( d.var7,'yyyymmdd') )),2,500, a.var6)) order by 1 asc; quit; Thanks
... View more
06-27-2017
10:14 AM
Thanks for your help. Much appreciate it.
... View more
06-27-2017
10:13 AM
No, it's not the exact positions. The observation position may change. Thanks @Astounding
... View more
06-27-2017
06:27 AM
Hi, Is there a way to get the set of observations in a dataset to the positions we want? For example the first 4 observations in the dataset HAVE1 should be moved to the last 4 observations as shown in WANT1 dataset below. DATA HAVE1; LENGTH F1 $8.; INPUT F1 $ ID$ F2 $ F3 F4 F5; datalines; %NAs 1 A 73 87 65 %NAs 1 B 7 19 63 %NAs 1 C 24 24 64 %NAs 1 D 75 63 58 0-10 1 A 73 21 16 0-10 1 B 29 94 17 0-10 1 C 48 6 99 0-10 1 D 26 46 9 11-50 1 A 48 21 10 11-50 1 B 49 37 45 11-50 1 C 8 88 48 11-50 1 D 16 48 7 51-100 1 A 57 95 18 51-100 1 B 64 73 63 51-100 1 C 28 84 95 51-100 1 D 55 84 17 ; run; DATA WANT1; LENGTH F1 $8.; INPUT F1 $ ID$ F2 $ F3 F4 F5; datalines; 0-10 1 A 73 21 16 0-10 1 B 29 94 17 0-10 1 C 48 6 99 0-10 1 D 26 46 9 11-50 1 A 48 21 10 11-50 1 B 49 37 45 11-50 1 C 8 88 48 11-50 1 D 16 48 7 51-100 1 A 57 95 18 51-100 1 B 64 73 63 51-100 1 C 28 84 95 51-100 1 D 55 84 17 %NAs 1 A 73 87 65 %NAs 1 B 7 19 63 %NAs 1 C 24 24 64 %NAs 1 D 75 63 58 ; run;
... View more
06-26-2017
09:23 AM
I just wanted to move 1st obs to the last obs. It's working as i expected from the below solution provided by @Astounding. Thanks for your efforts too.
... View more
06-26-2017
09:22 AM
Awesome, this is what I wanted. Thanks a lot for your contribution.
... View more
06-26-2017
08:45 AM
Hi, Is there a way to move the observations as shown below without using the sort option? data dataset; length Segment $13; input Segment var1 var2 var3; datalines; %_of_missing 19 23 12 0 32 43 23 1-10 23 534 343 11-20 434 432 42 21-30 23 123 543 31-40 443 2342 4234 41-50 32 25243 4523 51-100 324 5234 324 ; run; data want; length Segment $13; input Segment var1 var2 var3; datalines; 0 32 43 23 1-10 23 534 343 11-20 434 432 42 21-30 23 123 543 31-40 443 2342 4234 41-50 32 25243 4523 51-100 324 5234 324 %_of_missing 19 23 12 ; run; proc print data=dataset; run; proc print data=want; run;
... View more
06-17-2017
06:43 PM
Hi Tom, This is awesome too! It's perfectly working. Your contribution is much appreciated. Thanks
... View more
06-17-2017
05:46 PM
Fentastic! It's working @SuzanneDorinski. Appreciate your help on this!. Thanks
... View more
06-17-2017
05:32 PM
Wow! This is awesome @SuzanneDorinski. It's working. Thanks a lot for looking into this. But the only problem I have noticed is if you see the input file the value for Material Variable is "10000000000000" but in SAS it's reading as "10000000". Can we fix this by any chance? Thanks
... View more
06-17-2017
05:18 PM
Hi, I used the above option, but it's not working. Getting the below error. NOTE: Invalid data for Field7 in line 2 30-32. RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9-- Thanks
... View more
06-17-2017
02:17 PM
Hi, filename inp 'C:\Users\DATA3.txt'; data want; infile inp dlm='09'x pad missover truncover firstobs=2; input Field1 $ Field2 Field3 $ Field4 $ Field5 Field6 $ Field7 Field8 Field9; run; proc print;run;
... View more