<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to get description for all the variables in the dataset? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-description-for-all-the-variables-in-the-dataset/m-p/918610#M361837</link>
    <description>&lt;P&gt;You can get this information, it's just not in one place.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are assumptions of course, that you have labels specified, which are the descriptions and SAS formats are being used.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table part1 as 
select name, label, type, format
from sashelp.vcolumn
where libname='SASHELP' and memname='CARS';
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The second part depends on where you store the formats, assuming you know the formats, you can then do something like the following.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format cntlout = format_data;
select sex_fmt ...;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That should get you started at least.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/332712"&gt;@zihdonv19&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I expect to get this kind of table (as a separate SAS dataset rather than just display in the "results viewer"):&lt;/P&gt;
&lt;TABLE width="945"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="142"&gt;
&lt;P&gt;&lt;STRONG&gt;VARIABLE NAME&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="215"&gt;
&lt;P&gt;&lt;STRONG&gt;DESCRIPTION/LABEL&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138"&gt;
&lt;P&gt;&lt;STRONG&gt;TYPE/ FORMAT&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="174"&gt;
&lt;P&gt;&lt;STRONG&gt;VALUE DESCRIPTION&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="142"&gt;
&lt;P&gt;SEX&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="215"&gt;
&lt;P&gt;Sex of study participant&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138"&gt;
&lt;P&gt;Char&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="174"&gt;
&lt;P&gt;1 = Male&lt;/P&gt;
&lt;P&gt;2 = Female&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="142"&gt;
&lt;P&gt;DATE&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="215"&gt;
&lt;P&gt;Date of diagnosis&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138"&gt;
&lt;P&gt;Num&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="174"&gt;
&lt;P&gt;YYMMDD10.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="142"&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="215"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="174"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="142"&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="215"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="174"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="142"&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="215"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="174"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="142"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="215"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="174"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 01 Mar 2024 15:57:25 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2024-03-01T15:57:25Z</dc:date>
    <item>
      <title>How to get description for all the variables in the dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-description-for-all-the-variables-in-the-dataset/m-p/918436#M361775</link>
      <description>&lt;P&gt;I expect to get this kind of table (as a separate SAS dataset rather than just display in the "results viewer"):&lt;/P&gt;
&lt;TABLE width="945"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="142"&gt;
&lt;P&gt;&lt;STRONG&gt;VARIABLE NAME&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="215"&gt;
&lt;P&gt;&lt;STRONG&gt;DESCRIPTION/LABEL&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138"&gt;
&lt;P&gt;&lt;STRONG&gt;TYPE/ FORMAT&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="174"&gt;
&lt;P&gt;&lt;STRONG&gt;VALUE DESCRIPTION&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="142"&gt;
&lt;P&gt;SEX&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="215"&gt;
&lt;P&gt;Sex of study participant&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138"&gt;
&lt;P&gt;Char&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="174"&gt;
&lt;P&gt;1 = Male&lt;/P&gt;
&lt;P&gt;2 = Female&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="142"&gt;
&lt;P&gt;DATE&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="215"&gt;
&lt;P&gt;Date of diagnosis&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138"&gt;
&lt;P&gt;Num&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="174"&gt;
&lt;P&gt;YYMMDD10.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="142"&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="215"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="174"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="142"&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="215"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="174"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="142"&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="215"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="174"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="142"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="215"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="174"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Thu, 29 Feb 2024 16:59:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-description-for-all-the-variables-in-the-dataset/m-p/918436#M361775</guid>
      <dc:creator>zihdonv19</dc:creator>
      <dc:date>2024-02-29T16:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to get description for all the variables in the dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-description-for-all-the-variables-in-the-dataset/m-p/918441#M361777</link>
      <description>&lt;P&gt;Where is the "VALUE DESCRIPTION" created or stored?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the output you want, what is the input?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 17:05:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-description-for-all-the-variables-in-the-dataset/m-p/918441#M361777</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-02-29T17:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to get description for all the variables in the dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-description-for-all-the-variables-in-the-dataset/m-p/918443#M361779</link>
      <description>&lt;P&gt;Try:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc contents NOPRINT
  data=sashelp.class
  out=INFO_DATASET;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Feb 2024 17:08:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-description-for-all-the-variables-in-the-dataset/m-p/918443#M361779</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-02-29T17:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to get description for all the variables in the dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-description-for-all-the-variables-in-the-dataset/m-p/918447#M361783</link>
      <description>&lt;P&gt;I'm afraid that&amp;nbsp; your Value Description will have to come from somewhere else unless you have created such a data set somewhere. IF you have a custom format you could extract the information to some extent from the format information but will be up to you to format it, especially with large numbers of values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Type and Format would be separate columns in the output of Proc Contents, along with the variable name, label and order in the data set.&lt;/P&gt;
&lt;P&gt;Proc contents can create data sets, or you can extract information from SASHELP.VCOLUMN or Dictionary.Columns in Proc SQL after filtering for the library and member name for the desired data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 17:33:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-description-for-all-the-variables-in-the-dataset/m-p/918447#M361783</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-02-29T17:33:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to get description for all the variables in the dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-description-for-all-the-variables-in-the-dataset/m-p/918606#M361834</link>
      <description>&lt;P&gt;Thanks for your suggestion. I was just surprised SAS does not have this kind of coding...&lt;/P&gt;
&lt;P&gt;But do you think making the following table is feasible in SAS? That is: I want to display values for all the character variables with their labels of values?&lt;/P&gt;
&lt;TABLE width="872px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="348px"&gt;CHAR_VAR_NAME&lt;/TD&gt;
&lt;TD width="176px"&gt;OPTION_VALUE&lt;/TD&gt;
&lt;TD width="348px"&gt;LABEL&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="348px"&gt;SEX&lt;/TD&gt;
&lt;TD width="176px"&gt;1&lt;/TD&gt;
&lt;TD width="348px"&gt;Male&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="348px"&gt;SEX&lt;/TD&gt;
&lt;TD width="176px"&gt;2&lt;/TD&gt;
&lt;TD width="348px"&gt;Female&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="348px"&gt;DRUG&lt;/TD&gt;
&lt;TD width="176px"&gt;1&lt;/TD&gt;
&lt;TD width="348px"&gt;A&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="348px"&gt;DRUG&lt;/TD&gt;
&lt;TD width="176px"&gt;2&lt;/TD&gt;
&lt;TD width="348px"&gt;B&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="348px"&gt;DRUG&lt;/TD&gt;
&lt;TD width="176px"&gt;3&lt;/TD&gt;
&lt;TD width="348px"&gt;C&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Fri, 01 Mar 2024 15:39:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-description-for-all-the-variables-in-the-dataset/m-p/918606#M361834</guid>
      <dc:creator>zihdonv19</dc:creator>
      <dc:date>2024-03-01T15:39:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to get description for all the variables in the dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-description-for-all-the-variables-in-the-dataset/m-p/918609#M361836</link>
      <description>&lt;P&gt;If you want to see the definition of formats use PROC FORMAT.&lt;/P&gt;
&lt;P&gt;So if you have these two user defined formats:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format;
value sex 1='Male' 2='Female';
value drug 1='A' 2='B' 3='C';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And run PROC FORMAT with FMTLIB option you get a print out like this:&lt;/P&gt;
&lt;PRE&gt;----------------------------------------------------------------------------
|       FORMAT NAME: DRUG     LENGTH:    1   NUMBER OF VALUES:    3        |
|   MIN LENGTH:   1  MAX LENGTH:  40  DEFAULT LENGTH:   1  FUZZ: STD       |
|--------------------------------------------------------------------------|
|START           |END             |LABEL  (VER. V7|V8   01MAR2024:10:53:45)|
|----------------+----------------+----------------------------------------|
|               1|               1|A                                       |
|               2|               2|B                                       |
|               3|               3|C                                       |
----------------------------------------------------------------------------


----------------------------------------------------------------------------
|       FORMAT NAME: SEX      LENGTH:    6   NUMBER OF VALUES:    2        |
|   MIN LENGTH:   1  MAX LENGTH:  40  DEFAULT LENGTH:   6  FUZZ: STD       |
|--------------------------------------------------------------------------|
|START           |END             |LABEL  (VER. V7|V8   01MAR2024:10:53:45)|
|----------------+----------------+----------------------------------------|
|               1|               1|Male                                    |
|               2|               2|Female                                  |
----------------------------------------------------------------------------
&lt;/PRE&gt;
&lt;P&gt;So run PROC CONTENTS to see the information on the VARIABLES. And run PROC FORMAT to see the information on any formats that are being used with those variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that format definitions are INDEPENDENT of the variables they are used with.&amp;nbsp; So if you have 20 variables that all use the same codelist you only need to define and use one format.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 15:57:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-description-for-all-the-variables-in-the-dataset/m-p/918609#M361836</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-03-01T15:57:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to get description for all the variables in the dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-description-for-all-the-variables-in-the-dataset/m-p/918610#M361837</link>
      <description>&lt;P&gt;You can get this information, it's just not in one place.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are assumptions of course, that you have labels specified, which are the descriptions and SAS formats are being used.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table part1 as 
select name, label, type, format
from sashelp.vcolumn
where libname='SASHELP' and memname='CARS';
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The second part depends on where you store the formats, assuming you know the formats, you can then do something like the following.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc format cntlout = format_data;
select sex_fmt ...;
run;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That should get you started at least.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/332712"&gt;@zihdonv19&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I expect to get this kind of table (as a separate SAS dataset rather than just display in the "results viewer"):&lt;/P&gt;
&lt;TABLE width="945"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="142"&gt;
&lt;P&gt;&lt;STRONG&gt;VARIABLE NAME&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="215"&gt;
&lt;P&gt;&lt;STRONG&gt;DESCRIPTION/LABEL&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138"&gt;
&lt;P&gt;&lt;STRONG&gt;TYPE/ FORMAT&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="174"&gt;
&lt;P&gt;&lt;STRONG&gt;VALUE DESCRIPTION&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="142"&gt;
&lt;P&gt;SEX&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="215"&gt;
&lt;P&gt;Sex of study participant&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138"&gt;
&lt;P&gt;Char&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="174"&gt;
&lt;P&gt;1 = Male&lt;/P&gt;
&lt;P&gt;2 = Female&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="142"&gt;
&lt;P&gt;DATE&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="215"&gt;
&lt;P&gt;Date of diagnosis&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138"&gt;
&lt;P&gt;Num&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="174"&gt;
&lt;P&gt;YYMMDD10.&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="142"&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="215"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="174"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="142"&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="215"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="174"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="142"&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="215"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="174"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="142"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="215"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="138"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="174"&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 15:57:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-description-for-all-the-variables-in-the-dataset/m-p/918610#M361837</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2024-03-01T15:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to get description for all the variables in the dataset?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-get-description-for-all-the-variables-in-the-dataset/m-p/918624#M361845</link>
      <description>&lt;P&gt;Thank you everyone&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;, I generated the following to achieve my goal.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data exdata;
    input sex drug $;
    datalines;
0 A
1 B
1 C
0 A
1 B
0 C
;
run;

proc contents data=exdata; run;

proc format;
value sex 0='Male' 1='Female';
run;

proc format;
value $drug 'A'='Drug A' 'B'='Drug B' 'C'='Drug C';
run;

data exdata_label; set exdata; 
format sex sex. drug $drug.;
label sex = 'gender' drug = 'Type of Medication';
run;

proc sql;
create table part1 as 
select name, label as label_var, type, format
from sashelp.vcolumn
where libname='WORK' and memname='EXDATA_LABEL';
quit;

proc format cntlout = format_data (keep=fmtname start label);
select sex $drug;
run;

data value; set format_data; name = lowcase(fmtname); drop fmtname; run;

proc sql;
    create table var_info as
    select a.name, b.label_var, a.start, a.label, b.type, b.format
    from value as a
    left join part1 as b
    on a.name = b.name
	order by name, start
	;
quit;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 16:57:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-get-description-for-all-the-variables-in-the-dataset/m-p/918624#M361845</guid>
      <dc:creator>zihdonv19</dc:creator>
      <dc:date>2024-03-01T16:57:19Z</dc:date>
    </item>
  </channel>
</rss>

