Thanks Kurt, My base sas code is working fine but I want to make it dynamic and I don't want to sort the data because by variable name is different in other tables (ex: ID, in other table this ID is "empID") so I am looking in proc sql. my all macro %macro test(dsname,varname);
%if %varexist(&dsname,&varname) %then %do;
%if %getvartype(&dsname,&varname)=C %then %do;
if &varname ne ' ' then
&varname = "xxxxx";
%end;
%else %if %getvartype(&dsname,&varname)=N %then %do;
if &varname ne . then
&varname =11111;
%end;
%end;
%mend test;
%macro all(dsname);
%test(&dsname,Name);
%test(&dsname,forename);
%test(&dsname,sal);
%mend all; Thanks, SS
... View more