Date: Thu, 3 Aug 2006 09:06:09 -0400
Reply-To: Gerhard Hellriegel <ghellrieg@T-ONLINE.DE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Gerhard Hellriegel <ghellrieg@T-ONLINE.DE>
Subject: Re: How to extract letter?
Ok, you tell about many things about "sometimes with and sometimes
without...". I say, there must be enough rules to work with the data. Or
other: somebody can interpret the data with the appropriate set of rules. If
that is NOT possible, the data is garbage. If it IS possible, then simply
pack all that rules in a program.
If you need help, you should provide that rules and a few records of
test-data which contain all the cases which can occure.
On Thu, 3 Aug 2006 13:09:05 +0800, Yufei Wang <yufeiw@GMAIL.COM> wrote:
>Sorry to bother you.
>A dataset using "code" as the ID for each observation. Unfortunately, the
>"code" was composed of "time plot Doctor patient".
>My job is to split it to "time"+"plot"+"Doctor"+"patient".
>Although "doctor" and "patient" are all composed of exactly two letters or
>numbers, the "code" has different length because:
>1. The "plot" used both letter and number to be identified, and some plots
>numbered larger than 9 .
>For instance. "MD" or "M6", "M10";
>2. Regularly, the "code" have blank between each field when they were
>recorded, however, some don't have blank between "plot" and "Doctor".
>For instance, "12:55:01 MD PD C1", or "12:55:01 MDPD C1".
>I'm a biginner for SAS and programming, because of two above-mentioned
>reason, I can't use neither the length nor delimiter to extract the
>characters of each field.
>Can anybody help me or give me hint to solve this problem?
>Thanks in advance