[prev in list] [next in list] [prev in thread] [next in thread]
List: sas-l
Subject: Re: How to keep members enrolled in November who are active yet?
From: Irin later <000003de89a62f56-dmarc-request () LISTSERV ! UGA ! EDU>
Date: 2016-01-19 18:47:10
Message-ID: 1975252374.7300657.1453229230888.JavaMail.yahoo () mail ! yahoo ! com
[Download RAW message or body]
Thank you Jack. It solved the problem!
Irin
--------------------------------------------
On Tue, 1/19/16, Jack Clark <jclark@HILLTOP.UMBC.EDU> wrote:
Subject: Re: How to keep members enrolled in November who are active yet?
To: SAS-L@LISTSERV.UGA.EDU
Date: Tuesday, January 19, 2016, 7:19 AM
Thank you Andrew. Yes, I
missed the 'd' at the end of the date literals in my
example.
Irin, let us know
if this solves your problem.
Jack
Jack Clark
Senior Programmer
phone:
410-455-6256
fax: 410-455-6850
jclark@hilltop.umbc.edu
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]
On Behalf Of Clapson, Andrew
Sent: Saturday,
January 16, 2016 9:55 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: How to keep members enrolled in
November who are active yet?
Coming in late to this, but try writing your
date literals below as: '30NOV2015'd The 'd'
tells SAS to process the quoted value as a date.
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]
On Behalf Of Irin later
Sent: Friday,
January 15, 2016 5:21 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: How to keep members enrolled in
November who are active yet?
Jack,
SAS Error log said:
Expression using eqals (=) has components
that are of different data types Expression using eqals
(=) has components that are of different data types
Irin
--------------------------------------------
On Fri, 1/15/16, Jack Clark <jclark@HILLTOP.UMBC.EDU>
wrote:
Subject: Re: How to
keep members enrolled in November who are active yet?
To: SAS-L@LISTSERV.UGA.EDU
Date: Friday, January 15, 2016, 4:08 PM
Irin,
Is the 'time' part of the date
important, or just the 'date'. Some
databases store all dates as date/time format even when
you really only are interested in the 'date'. If
the date is all you need, you can use the DATEPART
function to get just the date from it.
Another
question...in your
statement below, do you mean a person has to have separate
records with both 2015-11-30 AND 2100-12-31...or at least
one record with 2015-11-30 OR 2100-12-31?
"-whose
end_date is the very last day of November
2015-11-30
23:59:59.000 and also -those
with end_date 2100-12-31
23:59:59.000
(which means currently active)"
I am assuming you mean they
have to have a record with one or the other date. Let us
know if that is not a correct assumption.
Something
like this may work (untested)...
proc sql;
create
table oct_mems_active as
select a.*
from oct_mems a,
(select
distinct id
from mems_enr_consol
where
datepart(end_date) = "30NOV2015" or
datepart(end_date) =
"31DEC2100")
b
where a.id = b.id
;
quit;
Jack Clark
Senior
Programmer
phone:
410-455-6256
fax: 410-455-6850
jclark@hilltop.umbc.edu
University of Maryland,
Baltimore County
Sondheim
Hall, 3rd Floor
1000 Hilltop Circle
Baltimore,
MD 21250
Please consider
the environment before printing this e-mail
and/or any attachments.
Confidentiality Notice: This
e-mail may
contain information that is legally privileged and that is
intended only for the use of the addressee(s) named above.
If you are not the intended recipient, you are hereby
notified that any disclosure, copying of this e-mail,
distribution, or action taken in reliance on the contents
of this e-mail and/or documents attributed to this e-mail
is strictly prohibited. If you have received this
information in error, please notify the sender immediately
by phone and delete this entire e-mail. Thank you.
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]
On Behalf Of Irin later
Sent: Friday,
January 15, 2016 3:23 PM
To:
SAS-L@LISTSERV.UGA.EDU
Subject: How to keep members enrolled in
November who are active yet?
I generated the dataset named OCT_MEMS with
the following fields:
-ID
-INFO
I should
make sure that members from the
table OCT_MEMS are also active in november 2015 and
active in DW house yet as we do not want them to get
letters if they are not active anymore (even if they were
in November).
DW table
MEMS_ENR_CONSOL table contains multiple records for each
member enrolled and disenrolled.
The fields
of interest are :
-ID
-END_DATE (which looks
like
2015-01-31 23:59:59.000 but it also contain values like
2100-12-31 23:59:59.000 (which means currently
active)
)
In order to feel save I
need all records of those in DW who are in ny table
OCT_MEMS and :
-whose end_date is the very last day of
November 2015-11-30 23:59:59.000 and also -those with
end_date 2100-12-31 23:59:59.000 (which means currently
active)
In
other words I should merge
both tables in order to keep currently active patients
which were active in november as well
Proc contents for DW
TABLE
MEMS_ENR_CONSOL looks like :
variable
type Len Format
Informat Label
ID
char 20 $20 $20
ID
end_date num 8
DATETIME22.3 DATETIME22.3
END_DATE
How can I extract them properly?
Thank you in advance!
Irin
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic