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.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: