<?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 data profile macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/data-profile-macro/m-p/69610#M15089</link>
    <description>I have 100 oracle tables that I can access through SAS and I want to create a dataset for reporting purposes that contains the count of records, min, max for every column in the the table.  &lt;BR /&gt;
&lt;BR /&gt;
So if Oracle has a table with the following:&lt;BR /&gt;
&lt;BR /&gt;
table xyz&lt;BR /&gt;
name1  name 2 name 3&lt;BR /&gt;
abc       def          hij&lt;BR /&gt;
bca                      lmn&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
The sas dataset would have the following information&lt;BR /&gt;
tablename  columnname count    min        max&lt;BR /&gt;
xyz               name1         2         abc        bca&lt;BR /&gt;
xyz               name2         1         def          &lt;BR /&gt;
xyz               name3         2          hij         lmn&lt;BR /&gt;
&lt;BR /&gt;
I have all the tables columns and fieldnames in a datset already from a proc dataset.  I am just not sure how to iterate through each column and set of a proc sql against the database to return the count min and max.  &lt;BR /&gt;
&lt;BR /&gt;
I have some code that comes close but not quite what I am trying to achieve.</description>
    <pubDate>Fri, 04 Sep 2009 22:25:16 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-09-04T22:25:16Z</dc:date>
    <item>
      <title>data profile macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/data-profile-macro/m-p/69610#M15089</link>
      <description>I have 100 oracle tables that I can access through SAS and I want to create a dataset for reporting purposes that contains the count of records, min, max for every column in the the table.  &lt;BR /&gt;
&lt;BR /&gt;
So if Oracle has a table with the following:&lt;BR /&gt;
&lt;BR /&gt;
table xyz&lt;BR /&gt;
name1  name 2 name 3&lt;BR /&gt;
abc       def          hij&lt;BR /&gt;
bca                      lmn&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
The sas dataset would have the following information&lt;BR /&gt;
tablename  columnname count    min        max&lt;BR /&gt;
xyz               name1         2         abc        bca&lt;BR /&gt;
xyz               name2         1         def          &lt;BR /&gt;
xyz               name3         2          hij         lmn&lt;BR /&gt;
&lt;BR /&gt;
I have all the tables columns and fieldnames in a datset already from a proc dataset.  I am just not sure how to iterate through each column and set of a proc sql against the database to return the count min and max.  &lt;BR /&gt;
&lt;BR /&gt;
I have some code that comes close but not quite what I am trying to achieve.</description>
      <pubDate>Fri, 04 Sep 2009 22:25:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/data-profile-macro/m-p/69610#M15089</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-09-04T22:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: data profile macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/data-profile-macro/m-p/69611#M15090</link>
      <description>Share the code you already have for feedback.  Also, if you have the PROC DATASETS output then you also have access to the SAS view of the LIBNAME associated with the SAS datasets -- you can use the SAS DICTIONARY TABLES view facility to build a SAS dataset list of each table and the associated colums/variables in each table.  Then with this information you can use SAS to generate PROC MEANS to get the MIN / MAX variable values within each SAS table.&lt;BR /&gt;
&lt;BR /&gt;
Recommend searching the SAS support  &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  website for DICTIONARY TABLES views using PROC SQL (or the DATA step alternative being SASHELP.Vxxxxxxx members, such as SASHELP.VCOLUMN.&lt;BR /&gt;
&lt;BR /&gt;
And you can either use SAS DATA step logic to generate the PROC MEANS code for each table, and capture the MEANS output to generate your desired info listed in your post.&lt;BR /&gt;
&lt;BR /&gt;
The SAS support website not only as the SAS-hosted product documentation guides but also there are technical and conference topic-oriented papers that will help guide you.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Sat, 05 Sep 2009 00:23:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/data-profile-macro/m-p/69611#M15090</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-09-05T00:23:30Z</dc:date>
    </item>
  </channel>
</rss>

