I'm interested in know if I can invoke Proc Contents and input my dataset name and a short list of some of it's variable names (but not all) and have it return just the variable name and it's Type, Length, Format, and Informat?
Any suggestions would be much appreciated.
Sure thing 🙂
ods select Variables;
ods output Variables=Variables;
proc contents data=sashelp.class(keep=name height);
run;
Something like this is probably the simplest
ods select Variables;
proc contents data=sashelp.class(keep=name height);
run;
wow this gives me great information. Thank you. Is there anyway to output this as a SAS dataset?
Sure thing 🙂
ods select Variables;
ods output Variables=Variables;
proc contents data=sashelp.class(keep=name height);
run;
For applying filters , I am afraid you are better off querying metadata from dictionary tables.
However, you can use dataset option with filters if you are writing the contents to an output dataset.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.