Date: Mon, 26 Feb 2007 07:31:52 -0800
Reply-To: Irin later <irinfigvam@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Irin later <irinfigvam@YAHOO.COM>
Subject: Re: How many in a single year ; in more than a single year and
etc
In-Reply-To: <456B52C41B724C41B96561D7AD283E7D0520A7@mail.chpdm.umbc.edu>
Content-Type: text/plain; charset=iso-8859-1
It looks like this code works. However I wonder if it works properly. Now I doubt if I should count process year as I initially set.
I mean…probably I should FIRST take out month part in order to use just year count:
Process_Yyyy
2005
2004
2003
rather than :
Process Yyyymm
200504
200501
200408
200504
200402
200309
Proc contents shows that Process Yyyymm field is numeric:
# Variable Type Len Pos Format Informat Label
1 Process_Yyyymm Num 8 32 Process Yyyymm
Considering it is numeric…How can I take month part out in order to use below code?
proc sql;
create table new as
select adm_key, count(distinct process_Yyyy) as year_cnt, count(*) as
adm_cnt
from disch_2004
group by adm_key
;
quit;
proc freq data = new;
tables year_cnt / nocum nopercent;
weight adm_cnt;
run;
How can I take month part out of the numeric value ( 200508)?
Thank you in advance!
Irin
Jack Clark <JClark@CHPDM.UMBC.EDU> wrote:
Irin,
See if this gets what you are after...
data test;
input Adm_key adm_mem_num Process_Yyyymm;
process_yr = substr(left(process_yyyymm),1,4);
cards;
8 12 200502
8 12 200504
9 11 200501
9 11 200408
7 10 200504
7 10 200402
7 10 200309
;
run;
proc sql;
create table new as
select adm_key, count(distinct process_yr) as year_cnt, count(*) as
adm_cnt
from test
group by adm_key
;
quit;
proc freq data = new;
tables year_cnt / nocum nopercent;
weight adm_cnt;
run;
Jack Clark
Research Analyst
Center for Health Program Development and Management
University of Maryland, Baltimore County
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Irin
later
Sent: Friday, February 23, 2007 2:55 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: How many in a single year ; in more than a single year and etc
I have Adm_key ; Adm_mem_num fields and process_year.
Adm_key adm_mem_num Process_Yyyymm
8 12 200502
8 12 200504
9 11 200501
9 11 200408
7 10 200504
7 10 200402
7 10 & nbsp; 200309
# Variable Type Len Pos Format Informat Label
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
ƒƒƒƒƒƒƒƒƒƒƒƒƒ
1 Adm_Key Num 8 0 Adm Key
2 Adm_Mem_Num Num 8 8 Adm Mem Num
3 Process_Yyyymm Num 8 32 Process Yyyymm
I need to know how many claims are in a single process year (regardless
monthes) and how many in more than single year. Something like the following
statistics based on the file above:
Just 2 admissions have claims in a single year (2005)
2 of them have claims in 2 different years (2005 & 2004)
3 of them have claims in more than 2 different years (2005 & 2004& 2003)
How can I produce this statistics??
Thank you in advance,
Irin
---------------------------------
8:00? 8:25? 8:40? Find a flick in no time
with theYahoo! Search movie showtime shortcut.
---------------------------------
Have a burning question? Go to Yahoo! Answers and get answers from real people who know.