Date: Mon, 16 Apr 2007 09:36:11 -0400
Reply-To: "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Subject: Re: truncate test string?
On Mon, 16 Apr 2007 10:01:56 +0000, toby dunn <tobydunn@HOTMAIL.COM> wrote:
>Match = ( VarA =: VArB ) ;
>The colon modifier truncates the longer the two strings to the length of the
>shorter and then does the compare between variables.
If you want to perform the evaluation in SQL, the colon modifier does not
work. However, there is a family of comparison operators with a "T" suffix
to indicate truncation. So the code might be like
select ... VarA EQT VArB as Match ...
>Subject: truncate test string?
>Date: Sun, 15 Apr 2007 22:17:50 -0700
>I've got two variable and I want to match them. Then problem is that
>variable A is longer than variable B and only the fisrt 6 characters
>are the same as that in variable B (if there's a match).
>Question: how can I truncate variable A to match it with B?