您可以使用dictionary.columns并执行此操作。
proc sql ;
select name into :keepcols SEPARATED by " " from dictionary.columns
where libname = "SASHELP"
and memname = "CARS"
and format = "DOLLAR8.";
proc sql ;
select name into :keepcols SEPARATED by " " from dictionary.columns
where libname = "SASHELP"
and memname = "CARS"
and format like "DOLLAR%";
data cars;
set sashelp.cars(keep = &keepcols);
run;