<?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 do I programatically detrmine the data type of a particular column in multiple tables? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-programatically-detrmine-the-data-type-of-a-particular/m-p/112821#M31231</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You actually do not want to code upcase(LIBNAME).&amp;nbsp; The values of the LIBNAME variable in DICTIONARY.COLUMNS will always be in uppercase.&amp;nbsp; If you include the UPCASE() function then SAS cannot use its internal index to skip looking at the datasets in all of the other librefs that you might have defined.&amp;nbsp; This can slow the execution down a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note also that an extra lowercase t seems to have slipped into the code you posted.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Sep 2012 23:18:19 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2012-09-05T23:18:19Z</dc:date>
    <item>
      <title>How do I programatically detrmine the data type of a particular column in multiple tables?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-programatically-detrmine-the-data-type-of-a-particular/m-p/112817#M31227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class="visitortext"&gt;&lt;SPAN lang="EN" style="font-family: 'Calibri','sans-serif'; color: windowtext; font-size: 11pt;"&gt; I have a program that compiles results from other individual programs (that verify that tables contain valid data - source to target). Occasionally, something happens where an individual program that creates the results table abends or creates an empty dataset.&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; color: windowtext; font-size: 11pt;"&gt;When this happens, the result table ends up with columns that have a data type of numeric rather than char (normal).&amp;nbsp; When this happens, the program that compiles all the results chokes because the data types of table columns (numeric) of empty datasets don’t agree with the ‘good’ ones (char).&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="visitortext"&gt;&lt;SPAN style="font-family: 'Calibri','sans-serif'; color: windowtext; font-size: 11pt;"&gt;I can run proc datasets to get the column data types of the results datasets and go through them visually to determine which datasets are bad but the number of datasets can exceed 100 so this is a labor intensive effort.&amp;nbsp; My question is:&amp;nbsp; Is there a way (progamatically) to identify result datasets where the data type of a particular column is numeric?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2012 19:45:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-programatically-detrmine-the-data-type-of-a-particular/m-p/112817#M31227</guid>
      <dc:creator>Mike7085</dc:creator>
      <dc:date>2012-09-05T19:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I programatically detrmine the data type of a particular column in multiple tables?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-programatically-detrmine-the-data-type-of-a-particular/m-p/112818#M31228</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try looking at the dictionary tables, this paper is a good read on the topic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could also save the contents of proc datasets to a table and work with that, but I think the dictionary tables are a better way to go.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www2.sas.com/proceedings/sugi30/070-30.pdf"&gt;www2.sas.com/proceedings/sugi30/070-30.pdf&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2012 19:54:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-programatically-detrmine-the-data-type-of-a-particular/m-p/112818#M31228</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2012-09-05T19:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I programatically detrmine the data type of a particular column in multiple tables?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-programatically-detrmine-the-data-type-of-a-particular/m-p/112819#M31229</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;is the example helpful?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc contents data=sashelp.class&amp;nbsp; &lt;/P&gt;&lt;P&gt;out=temp(keep=libname memname type name where=(lowcase(name)='age')) noprint;&lt;/P&gt;&lt;P&gt;proc print;run;&lt;/P&gt;&lt;P&gt; obs&amp;nbsp;&amp;nbsp;&amp;nbsp; LIBNAME&amp;nbsp;&amp;nbsp;&amp;nbsp; MEMNAME&amp;nbsp;&amp;nbsp;&amp;nbsp; NAME&amp;nbsp;&amp;nbsp;&amp;nbsp; TYPE&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SASHELP&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CLASS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Age&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2012 20:10:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-programatically-detrmine-the-data-type-of-a-particular/m-p/112819#M31229</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-09-05T20:10:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I programatically detrmine the data type of a particular column in multiple tables?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-programatically-detrmine-the-data-type-of-a-particular/m-p/112820#M31230</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Between the two answers, I got what I needed.&amp;nbsp; Here's the code I ran:&lt;/P&gt;&lt;P&gt;libname fdrcert '/depts/results';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select name, memname, type&lt;/P&gt;&lt;P&gt;from dictionary.columns&lt;/P&gt;&lt;P&gt;where upcase(libname) = 'FDRCERTt' and&lt;/P&gt;&lt;P&gt;upcase(name) = 'TARGET';&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to you both for your quick and helpful responses!!:smileygrin:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2012 22:25:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-programatically-detrmine-the-data-type-of-a-particular/m-p/112820#M31230</guid>
      <dc:creator>Mike7085</dc:creator>
      <dc:date>2012-09-05T22:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: How do I programatically detrmine the data type of a particular column in multiple tables?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-do-I-programatically-detrmine-the-data-type-of-a-particular/m-p/112821#M31231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You actually do not want to code upcase(LIBNAME).&amp;nbsp; The values of the LIBNAME variable in DICTIONARY.COLUMNS will always be in uppercase.&amp;nbsp; If you include the UPCASE() function then SAS cannot use its internal index to skip looking at the datasets in all of the other librefs that you might have defined.&amp;nbsp; This can slow the execution down a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note also that an extra lowercase t seems to have slipped into the code you posted.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Sep 2012 23:18:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-do-I-programatically-detrmine-the-data-type-of-a-particular/m-p/112821#M31231</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-09-05T23:18:19Z</dc:date>
    </item>
  </channel>
</rss>

