Date: Fri, 30 Mar 2007 09:19:06 -0700
Reply-To: Rune Runnestø <rune@FASTLANE.NO>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Rune Runnestø <rune@FASTLANE.NO>
Organization: http://groups.google.com
Subject: How to decide the case of words in a column in a dataset
Content-Type: text/plain; charset="iso-8859-1"
I wonder how to find out what case a word in a column in a data set is
in.
I have made an example to illustrate the task. The field TEXT contains
just one word.
Does SAS have a function to use here ?
Or how can I use regular expression if that is a possibility ?
Rune
data myds;
infile datalines truncover;
attrib text length = $10.;
input @01 text $10.;
datalines;
Mixedcase
UPPERCASER
lowercase
pepsi
COLA
Juice
;
run;
data two;
set myds;
length case $5.;
if <some test> then case = 'upper'
else if <some test> then case = 'mixed'
else if <some test> then case = 'lower';
run;
|