Date: Fri, 16 Jan 2004 17:32:23 -0500
Reply-To: "Droogendyk, Harry" <Harry.Droogendyk@CIBC.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Droogendyk, Harry" <Harry.Droogendyk@CIBC.COM>
Subject: Re: Ignore Case?
Content-Type: text/plain; charset="iso-8859-1"
If the input record is really wide, it may be more efficient to upcase only
the fields you really care about using the $upcase. informat:
data _null_;
input (alpha1-alpha4) ($upcase.);
put alpha1-alpha4 ;
cards;
qw fgH JP Yy
;
1 data _null_;
2 input (alpha1-alpha4) ($upcase.);
3 put alpha1-alpha4 ;
4 cards;
QW FGH J P YY
-----Original Message-----
From: Howard Schreier [mailto:Howard_Schreier@ITA.DOC.GOV]
Sent: January 16, 2004 4:56 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: Ignore Case?
That's how I usually do things; preserve the original data and use
functions to make things case insensitive as needed.
But if you are reading in wide records and want everything in upper or
lower case, _INFILE_ magic is a handy "shotgun". For example:
data _null_;
input @;
_infile_ = upcase(_infile_);
input (alpha1-alpha4) ($);
put alpha1-alpha4 ;
cards;
qw fgH JP Yy
;
Result:
QW FGH JP YY
On Tue, 13 Jan 2004 08:36:37 -0500, Dennis Diskin
<diskin.dennis@KENDLE.COM> wrote:
>Mike,
>
>Use the UPCASE function where you refer to your variable: eg. IF
>UPCASE(varname) EQ 'JACK' THEN
>
>HTH,
>Dennis Diskin
>
>
>
>
>
>"Tonkovich, Mike" <Mike.Tonkovich@DNR.STATE.OH.US>
>Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
>01/13/2004 08:33 AM
>Please respond to "Tonkovich, Mike"
>
>
> To: SAS-L@LISTSERV.UGA.EDU
> cc:
> Subject: Ignore Case?
>
>
>Good morning group. By chance, does anyone know if there is a way to have
>SAS ignore "case"? For instance, if it reads JacK, or JACK, or jack, it
>assigns a new value of JACK to those observations. Any help would be
>greatly appreciated. I was hoping I could avoid a bunch of if-then
>statements. I'm working with 88 4-letter abbreviations for county names
>and
>the program to accommodate the myriad of variations would likely be rather
>large and cumbersome.
>
>Thanks.
>
>Mike