You can get variable names, labels and formats from Dictionary.columns (or sashelp.vcolumn) given a library and dataset name.
Or with proc contents. But are you sure every variable has a format assigned? a Label?
And what information in the data set metadata tells you that a variable is categorical or continuous?
The following code creates a table of properties of the data set SASHELP.BASEBALL.
proc sql;
create table work.properties as
select name, type,label,format
from dictionary.columns
where libname='SASHELP' and memname='BASEBALL';
quit;
Note the TYPE will be "char" or "num" in the resulting set. I don't know how to get CTN or CTG from these properties for this data set.
That might be sufficient with a data step using that information to create either an %include file with the call to the macro using that data set information, or Call execute
... View more