Date: Thu, 11 Mar 2010 07:47:36 -0800
Reply-To: Ruby <windofoct@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Ruby <windofoct@GMAIL.COM>
Organization: http://groups.google.com
Subject: How to find out the desired string
Content-Type: text/plain; charset=ISO-8859-1
Hi SAS experts,
I need to find out the qualified enrollees from enrollment dataset
based on the following specification - Enrollees have been enrolled in
the program for at least 6 months and with no more than one month gap
in enrollment.
I also have a character variable called "flag" to indicate monthly
enrollment status.For example, "010000000001" stands for the member
enrolled in February and December.
Here is my code.
if index(flag,'111111')^=0 or
index(flag,'1011111')^=0 or
index(flag,'1101111')^=0 or
index(flag,'1110111')^=0 or
index(flag,'1111011')^=0 or
index(flag,'1111101')^=0 then output;
Do you have a better way to code my question?
Thanks very much!
|