Hi Guys,
How to view all tables and its variable names, type and length in a library?
The registered library name is CDSSTG. Currently it has alot of SAS Datasets in it and each of the tables has its own Columns, type and length.
I tried proc contents:
proc contents data=CDSSTG._all_ nods; run;
I also tried proc datasets:
proc datasets lib=CDSSTG;
run;
But i am not getting the full columns attributes.
Need your guidance. Also, i would like to list the full list, not just limited to 10 rows.
You are mixing up usages here, clarify what you wat to do. In the code you provide you are creating macro variables for each column. From your original description you want dataset which holds all the metadata from that library - this already exists in the form of the SASHELP library (dictionarys is the SQL version of the same thing), so to get what you originally wanted then:
data want; set sashelp.vcolumn (where=(libname="CDSSTG")); run;
This wil create a dataset want with all the column metadata. If you can provide more clarified information as to what you want this can be adapted.
You need to use the dictionary it seems.
You are mixing up usages here, clarify what you wat to do. In the code you provide you are creating macro variables for each column. From your original description you want dataset which holds all the metadata from that library - this already exists in the form of the SASHELP library (dictionarys is the SQL version of the same thing), so to get what you originally wanted then:
data want; set sashelp.vcolumn (where=(libname="CDSSTG")); run;
This wil create a dataset want with all the column metadata. If you can provide more clarified information as to what you want this can be adapted.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.