<?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: Variable name and Variable type in a library in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Variable-name-and-Variable-type-in-a-library/m-p/337432#M76621</link>
    <description>&lt;P&gt;If you use this code you can find out how to request other items from dictionary.columns&lt;/P&gt;
&lt;PRE&gt;proc sql;
   describe table dictionary.columns;
run;&lt;/PRE&gt;
&lt;P&gt;which would lead to&lt;/P&gt;
&lt;PRE&gt;proc sql;
   create table columns as
   select name as variable
   ,memname as table_name,type
   from dictionary.columns
   where libname = 'WORK'
;
quit;&lt;/PRE&gt;</description>
    <pubDate>Thu, 02 Mar 2017 16:25:34 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2017-03-02T16:25:34Z</dc:date>
    <item>
      <title>Variable name and Variable type in a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-name-and-Variable-type-in-a-library/m-p/337217#M76550</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to export all the variable name, their trype(char, num, data), along with their dataset name to a Excel sheet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tried the following code(thanks to SASKIWI) , but got only the list of variables name and respective dataset thary belong, i need the variable type as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please suggest&lt;/P&gt;&lt;P&gt;/* Note that value of libname is UPPERCASE */&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; columns &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; name &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; variable&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt;,memname &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; table_name&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; dictionary.columns&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;where&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; libname = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'WORK'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;/* SAS 9.4 or later */&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ods&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;excel&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;file&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"C:\e_Contents.xlsx"&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;style&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=minimal;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;print&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=columns;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;ods&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;excel&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;close&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;/* earlier versions, using SAS/ACCESS to PC Files */&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;PROC&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;EXPORT&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;data&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; = columns&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;OUTFILE&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; = &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'e_Contents.xls'&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;DBMS&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; = EXCEL &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;REPLACE&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;SHEET&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'VARLIST'&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2017 02:49:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-name-and-Variable-type-in-a-library/m-p/337217#M76550</guid>
      <dc:creator>SAS_INFO</dc:creator>
      <dc:date>2017-03-02T02:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: Variable name and Variable type in a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-name-and-Variable-type-in-a-library/m-p/337218#M76551</link>
      <description>&lt;P&gt;thanks Guys,&lt;/P&gt;&lt;P&gt;Got it....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the following code works&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Proc contents data=work._ALL_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2017 02:56:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-name-and-Variable-type-in-a-library/m-p/337218#M76551</guid>
      <dc:creator>SAS_INFO</dc:creator>
      <dc:date>2017-03-02T02:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: Variable name and Variable type in a library</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Variable-name-and-Variable-type-in-a-library/m-p/337432#M76621</link>
      <description>&lt;P&gt;If you use this code you can find out how to request other items from dictionary.columns&lt;/P&gt;
&lt;PRE&gt;proc sql;
   describe table dictionary.columns;
run;&lt;/PRE&gt;
&lt;P&gt;which would lead to&lt;/P&gt;
&lt;PRE&gt;proc sql;
   create table columns as
   select name as variable
   ,memname as table_name,type
   from dictionary.columns
   where libname = 'WORK'
;
quit;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Mar 2017 16:25:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Variable-name-and-Variable-type-in-a-library/m-p/337432#M76621</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-03-02T16:25:34Z</dc:date>
    </item>
  </channel>
</rss>

