- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I have a very straightforward question. Within a program, how do I code to create a table that shows me the attributes (only variable name, format and format length) of a given table that was already created.
Thank you in advance.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Proc contents will generate what you want though the default data set from the OUT= option may have more information than you want.
Proc contents data=mydatasetname out=description;
run;
The procedure by default will send output to the Results window. There are options like NOPRINT to suppress all results or Nodetails to reduce what appears.
If you want to display just some of the data that is what Proc Print does, select the variables you want with a VAR statement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Proc contents will generate what you want though the default data set from the OUT= option may have more information than you want.
Proc contents data=mydatasetname out=description;
run;
The procedure by default will send output to the Results window. There are options like NOPRINT to suppress all results or Nodetails to reduce what appears.
If you want to display just some of the data that is what Proc Print does, select the variables you want with a VAR statement.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
You can query that information from the SASHELP.VCOLUMN table quite easily.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Or, in SQL, you use DICTIONARY.COLUMNS (which is the base for SASHELP.VCOLUMN).