LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (March 2007, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 30 Mar 2007 11:02:15 -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: UPCASE in Keep statement

On Fri, 30 Mar 2007 09:17:21 -0400, Ran S <raan67@YAHOO.COM> wrote:

>Hello, > >Can I use UPCASE in the Keep statement? I would like to keep variables with >capital letters. > >Thank you

You cannot use the UPCASE function to screen variable names in the KEEP or DROP statements or data set options.

If I understand your needs correctly, you can accomplish your task by inspecting the metadata.

Here is an example.

data before; retain onlylower ONLYUPPER MiXeDcAsE 0; run;

proc sql noprint;

select name into : some_upper separated by ' ' from dictionary.columns where libname eq 'WORK' and memname eq 'BEFORE' and name ne lowcase(name) ;

quit;

data after; set before; keep &some_upper; run;

AFTER contains only the variables ONLYUPPER and MiXeDcAsE.


Back to: Top of message | Previous page | Main SAS-L page