|
I think this may be close to what you are asking.
data work.one;
var1u = 'keep me lowcase var1u';
au = 'User specified au';
var1 = 'Value of var1';
bu = 'User spec bu';
var2 = 'value of var2';
ageu = 'Years';
c = 'c';
ringer = 1;
var2u = 'keep me lowcase var2u';
run;
%let userSpecified = au bu c;
data work.two;
set one;
array _up(*) $ _character_;
length upVname $32;
do _i_ = 1 to dim(_up);
upVname = upcase(vname(_up[_i_]));
if left(upcase(reverse(upVname))) ne: 'U'
or (upcase(upVname) eq: 'AGEU')
or indexw("%upcase(&userspecified)",upVname) then do;
_up[_i_] = upcase(_up[_i_]);
end;
end;
drop _i_ upVname;
run;
SAS_my_life wrote:
> Hello All,
>
> I need to Upper case data in all variables EXCEPT data contained in a
> variable that end in the letter "u" (or "U"), with the exceptions of
> "AGEU" and any user-specified variables.
>
> And the program should indicate in the log if the variables specified
> by the user do not exist in the dataset.
>
> Thanks for the help and time.
|