Date: Fri, 10 Nov 2000 10:13:03 -0800
Reply-To: "Terjeson, Mark" <TERJEMW@DSHS.WA.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Terjeson, Mark" <TERJEMW@DSHS.WA.GOV>
Subject: Re: How to convert all variable names into upper cases?
Content-Type: text/plain; charset="iso-8859-1"
First off, there's nothing wrong with "working" code.
Your macro indeed does the job.
I'm not sure what all characteristics you're looking
for, but here's one alternative:
This command immediately converts, not only
field names but dataset names as well, for all
previously opened datasets and subsequent
datasets via the sashelp.vcolumn table. Which
means, while your session is open, all existing
datasets look and process like they were upper
(even though they are still stored on disk as
they were previously) and any newly written
datasets will be stored as upper.
libname ccc 'c:\temp';
data ccc.test; * currently stored on disk as mixed case ;
AAA = 1;
bbb = 2;
Ccc = 3;
data ccc.test2; * will store on disk as upper ;
Hope this is helpful,
Washington State Department of Social and Health Services
Division of Research and Data Analysis (RDA)
From: Victor Kamensky [mailto:kamensky@AECOM.YU.EDU]
Sent: Friday, November 10, 2000 9:36 AM
Subject: How to convert all variable names into upper cases?
a). The problem. (V8).
Variable names can be in uppercase and in lowercase.
Sometimes alphabetical order in proc contents is desired.
How to convert all variable names into upper cases?
b) My quick tested solution:
proc contents noprint data=&dataset out=_c_(keep=name);run;
data _c_; set _c_; length upname $ 32;
%if &nobs > 0 %then
data _null_; set _c_ end=last;
if _N_=1 then
call execute("data &dataset; set &dataset; rename");
if last then
call execute("; run;");
c) I understand my solution is old-fashioned.
Surely someone can come with a modern solution.
But will it be simpler? Or (and) shorter?
Albert Einstein College of Medicine