07-05-2019
Dynamike
Calcite | Level 5
Member since
09-11-2017
- 21 Posts
- 1 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by Dynamike
Subject Views Posted 1705 07-04-2019 12:38 AM 1775 07-03-2019 11:44 AM 1779 07-03-2019 11:42 AM 1817 07-03-2019 09:12 AM 1422 12-03-2018 09:29 AM 1076 11-14-2018 06:01 AM 1100 11-14-2018 04:23 AM 7605 10-15-2018 08:01 AM 1027 10-11-2018 08:49 AM 1332 10-11-2018 05:58 AM -
Activity Feed for Dynamike
- Posted Re: Person Count for several years on New SAS User. 07-04-2019 12:38 AM
- Posted Re: Person Count for several years on New SAS User. 07-03-2019 11:44 AM
- Posted Re: Person Count for several years on New SAS User. 07-03-2019 11:42 AM
- Posted Person Count for several years on New SAS User. 07-03-2019 09:12 AM
- Liked Re: Output three years with suffix for PaigeMiller. 12-04-2018 01:39 AM
- Posted Output three years with suffix on SAS Programming. 12-03-2018 09:29 AM
- Posted Re: Informat CSV Date with type "2017-01-01 00:00:00" on New SAS User. 11-14-2018 06:01 AM
- Posted Informat CSV Date with type "2017-01-01 00:00:00" on New SAS User. 11-14-2018 04:23 AM
- Posted Last day of a month in mdy with given month and year on New SAS User. 10-15-2018 08:01 AM
- Posted Re: Calculating differences from several columns to identify interruptions on SAS Programming. 10-11-2018 08:49 AM
- Posted Re: Data Step: by two groups (First.id and first.department) on SAS Programming. 10-11-2018 05:58 AM
- Posted Data Step: by two groups (First.id and first.department) on SAS Programming. 10-11-2018 05:30 AM
- Posted Re: Calculating differences from several columns to identify interruptions on SAS Programming. 10-11-2018 04:05 AM
- Posted Calculating differences from several columns to identify interruptions on SAS Programming. 10-11-2018 03:24 AM
- Posted Create several tables by year from one original table on SAS Programming. 10-04-2018 10:09 AM
- Posted Add missing rows for several subgroups on SAS Programming. 05-25-2018 03:11 PM
- Posted Re: Proc Tabulate: Mean Median etc. in the column instead of row on SAS Programming. 09-15-2017 12:58 AM
- Posted Proc Tabulate: Mean Median etc. in the column instead of row on SAS Programming. 09-15-2017 12:38 AM
- Posted Re: Convert numeric week of the year to date on SAS Procedures. 09-12-2017 01:43 AM
- Posted Re: Convert numeric week of the year to date on SAS Procedures. 09-12-2017 01:34 AM
-
Posts I Liked
Subject Likes Author Latest Post 1
07-04-2019
12:38 AM
Thank you for your advice. Counting the person within a year is only the first step. Do you know how to add the sum of days per year for all person (which i can then divide easily by 365 days) Thank you for your effort.
... View more
07-03-2019
11:44 AM
Thank you for your answer. The code does not work properly See the reply to Reeza for more Information, what the result should look like.
... View more
07-03-2019
11:42 AM
Hi thank you for your answer and sorry for not showing input and output data: Input data looks like this: Person start end 1 02/01/2006 30/07/2009 2 04/04/2009 30/11/2011 3 05/04/2007 03/02/2011 Output data should look like this: year Count 2005 0 2006 1 2007 2 2008 2 2009 3 2010 2 2011 2 OR if this is not possible: Count_2005 Count_2006 Count_2007 Count_2008 …. 0 1 2 2
... View more
07-03-2019
09:12 AM
How can i simplify this code (macro or loop): Proc SQL; Create Table Test as select distinct Count(distinct case when 2005 GE year(start) and 2005 LE year(end) then person else . end) as person_count_2005 , Count(distinct case when 2006 GE year(start) and 2006 LE year(end) then person else . end) as person_count_2006 , Count(distinct case when 2007 GE year(start) and 2007 LE year(end) then person else . end) as person_count_2007 , Count(distinct case when 2008 GE year(start) and 2008 LE year(end) then person else . end) as person_count_2008 , Count(distinct case when 2009 GE year(start) and 2009 LE year(end) then person else . end) as person_count_2009 , Count(distinct case when 2010GE year(start) and 2010 LE year(end) then person else . end) as person_count_2010 , Count(distinct case when 2011 GE year(start) and 2011 LE year(end) then person else . end) as person_count_2011 from data; quit; This is example only for the years 2005 to 2011, but i want count person for more years. Thank you for your effort! Dynamike
... View more
12-03-2018
09:29 AM
Hi all, i have the following data set: ID year Cost X 2015 100 X 2016 200 X 2017 150 Y 2015 30 Y 2016 70 Y 2017 400 ... Now i want separated data tables for each year and tried: %Macro Test; %do i=2015 %to 2017; Data Cost_&i; set in; If year=&i then output %end; %MEND Test; %Test This doesnt work. Could you please help me. Thank you for your effort! Mike
... View more
11-14-2018
06:01 AM
thank you! That works! But, if there is more than one instring e.g. "2017-01-01 00:00:00" "2018-03-25 00:00:00" "2016-05-03 00:00:00" my solution would be: DATA Test_Out; LENGTH tod_datum $ 10; FORMAT tod_datum yymmddd10.; INFORMAT tod_datum yymmddd10.; INFILE 'C:\Test_In.csv' delimiter=',' MISSOVER firstobs=2 DSD LRECL=32767; INPUT tod_datum : ?? $CHAR23. RUN; Data test_out; Set test_out; todtag=input(tod_datum,yymmdd10.); format todtag ddmmyy10.; run; This works, but is there no direct way? informat not as a string, but another date format (E8601DTw.d seems to be similar, but does not work). Or is there another way to avoid the second data step? Thank u for ur effort! Mike
... View more
11-14-2018
04:23 AM
Hi all, a csv data file consists of a variable "date" with the following type "2017-01-01 00:00:00" How can import such an type. I don't need the information of time "00:00:00" So MMDDYY10. would be fine, but it does not work. The result is a missing value. Thank you for your help! Mike
... View more
10-15-2018
08:01 AM
Hi all, i have the following data set: ID MONTH YEAR x 2 2015 y 4 2015 z 10 2016 Now i want to create a date variable with given month and year as well as the last day of the month: Data test; Set test; Date=MDY(MONTH,31,YEAR); format date ddmmyy10.; run; But this only works for ID z because October consists of 31 days, but February (28) and April (30) not. Is there any function, which automatically generates the day information as last day for the given month? Thank you for ur effort! Mike
... View more
10-11-2018
08:49 AM
Thank you this works very well! Now i know there is an interruption and when. Is it possible to add an information how long the interruption took place? Thank you in advance! Mike
... View more
10-11-2018
05:58 AM
Sorry my fault: VERSID is the same as ID. I have corrected it in the original post. Thank you for your advice!
... View more
10-11-2018
05:30 AM
Hi all, i have the following: I want to define a minimum regarding ID as main variable (which works). ID MIN_DATE 1 01/02/2015 Proc Sort Data=have; by ID YEAR MONTH; run; Data MIN; set have; by ID; MIN_YEAR=YEAR; MIN_MONTH=MONTH; MIN_DATE=MDY(MIN_MONAT,1,MIN_JAHR); format MIN_DATE ddmmyy10.; If First.ID then output; Run; Now i want to define a minimum for ID as well as for another subvariable (X) and this should look like this: ID X MIN_DATE 1 a 01/02/2015 1 b 01/04/2016 i tried this: Proc Sort Data=have; by ID X YEAR MONTH; run; Data MIN; set have; by ID X; MIN_YEAR=YEAR; MIN_MONTH=MONTH; MIN_DATE=MDY(MIN_MONAT,1,MIN_JAHR); format MIN_DATE ddmmyy10.; If First.ID AND FIRST.X then output; Run; But my subvariable X is not considered.....its just the same as above. Could you help me? Best regards Mike
... View more
10-11-2018
04:05 AM
Thank you very much for ur quick answer. So am i right?: flag=1 could also signify the end of the therapy, BUT if there is missed > 0 there is at least one interruption in between. best regards Mike
... View more
10-11-2018
03:24 AM
Hi all, my table looks like this: ID Name COL1 COL2 COL3 COL4 COL5 COL6 ....COL78 x MONTH 1 2 3 4 5 6 y MONTH 4 5 6 . 8 9 z MONTH 12 1 2 3 . . ID is the variable for the patient and COL consists of the number of the month of a year (12 is December, 1 January....). So what i want to know is the following: Are there any interruptions for e.g. patient y regarding the therapy? And of course there is an interruption (see COL4). I think first of all i have to calculate the differences between each variable COL2-COL1 COL3-COL2 .... COL78-COL77. And then if this difference does not equals 1 there is an interruption (but what is if its December to January 1-12=-11. this also an valid value or if the missing is at the end (patient z) this not an interruption, this the end of the therapy (which is ok)). Do you have any idea to solve this with an macro or something like this (i have no marco experience at all). Do you need more information to help me? Thank you for ur effort! Mike
... View more
10-04-2018
10:09 AM
Hi all, i think its an easy task for you, but obviously not for me. i have one original table looks like that: year information 2015 x 2016 y 2015 z 2014 x What i want to do is to create three tables named test2014, test2015, test2016 including only the information related to the named year: test2014: year information 2014 x test2015: year information 2015 x 2015 z test2016: year information 2016 y i tried something like this. year=&year. Data Test&year; set originaldata; DO year=2014 to 2016; where year=&year; end: run; But i think there is some basic macro/loop knowledge missing 😕 Thank you for your effort! Mike
... View more
05-25-2018
03:11 PM
Hello community:) Some background Information for my question: There a five diagnosis: A,B,C,D,E and four age groups: 0-4, 5-9, 10-15, 16-20 and there is a numerical variable for the number of patients in each group Now i have the following problem. My table looks like this: diagnosis age_group number_patients A 0-4 3 A 10-15 2 A 5-9 15 A 16-20 8 B 16-20 1 C 5-9 1 D 0-4 1 D 16-20 6 D 5-9 2 E 0-4 1 and i want my table look like this (including all Information even if its missing and in the right order regarding the age age groups): diagnosis age_group number_patients A 0-4 3 A 5-9 15 A 10-15 2 A 16-20 8 B 0-4 . B 5-9 . B 10-15 . B 16-20 1 C 0-4 . C 5-9 1 C 10-15 . C 16-20 . D 0-4 1 D 5-9 2 D 10-15 . D 16-20 6 E 0-4 1 E 5-9 . E 10-15 . E 16-20 . i hope someone could help me or link me to an answer! Thank you for your effort! Dynamike
... View more