I think this may be close to what you are asking.
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';
%let userSpecified = au bu c;
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_]);
drop _i_ upVname;
> 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.