<?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: Creating a table in SAS without using SQL in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-table-in-SAS-without-using-SQL/m-p/481705#M286788</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/139341"&gt;@kmardinian&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you! But then is it possible to use proc means and proc summary to create a customized table?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;One thing you will have to consider is which type of "table" do you mean? Do you mean a data set such as is used for further analysis or reporting or a simple report from existing data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Procs Mean, Summary, Freq, Tabulate and Report will all do both to some extent.&lt;/P&gt;
&lt;P&gt;For example (your should have the SASHELP.CLASS data set available):&lt;/P&gt;
&lt;PRE&gt;proc means data=sashelp.class n mean max min std lclm uclm;
   class sex;
   var  height weight;
   output out=work.summary;
run;&lt;/PRE&gt;
&lt;P&gt;Will produce a report table in the results window in one format and with the output statement a data set that looks like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sex    _TYPE_    _FREQ_    _STAT_     Height     Weight

          0        19       N        19.0000     19.000
          0        19       MIN      51.3000     50.500
          0        19       MAX      72.0000    150.000
          0        19       MEAN     62.3368    100.026
          0        19       STD       5.1271     22.774
 F        1         9       N         9.0000      9.000
 F        1         9       MIN      51.3000     50.500
 F        1         9       MAX      66.5000    112.500
 F        1         9       MEAN     60.5889     90.111
 F        1         9       STD       5.0183     19.384
 M        1        10       N        10.0000     10.000
 M        1        10       MIN      57.3000     83.000
 M        1        10       MAX      72.0000    150.000
 M        1        10       MEAN     63.9100    108.950
 M        1        10       STD       4.9379     22.727


&lt;/PRE&gt;
&lt;P&gt;The _type_ variable refers to level(s) of the class variable(s) used; _freq_ is the number of records used, _stat_ indicates which statistic is reported on that line for the variables and the last two columns hold the actual statistic values (excluding the confidence limits as I didn't add all of the syntax needed for that).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In general having a single column with multiple types of data is often considered a poor idea.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The report procedures Tabulate and Report will allow most of the same statistics as Means/Summary and a few others as well plus displaying output in grouped, nested and across behaviors.&lt;/P&gt;</description>
    <pubDate>Thu, 26 Jul 2018 22:26:44 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-07-26T22:26:44Z</dc:date>
    <item>
      <title>Creating a table in SAS without using SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-table-in-SAS-without-using-SQL/m-p/481652#M286785</link>
      <description>&lt;P&gt;Hi, I am currently trying to create a table with rows and columns that have different analyses in them..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to create a row that contains the N number of each column group and wanted to know whether there is an interesting way to accomplish this in SAS using a data step.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is how I created the first row and column, but I'd like to now start creating tables with N values, 95% CI, things like that.&lt;/P&gt;&lt;P&gt;data row1;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; length rowlabel $100 col_1 col_2 col_3 col_4 $32 ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; rowlabel='Score:';&lt;BR /&gt;&amp;nbsp;&amp;nbsp; col_1='X';&lt;BR /&gt;&amp;nbsp;&amp;nbsp; col_2='Y';&lt;BR /&gt;&amp;nbsp;&amp;nbsp; col_3='Total';&lt;BR /&gt;&amp;nbsp;&amp;nbsp; col_4='X-Y';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any advice would be very helpful!!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jul 2018 19:23:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-table-in-SAS-without-using-SQL/m-p/481652#M286785</guid>
      <dc:creator>kmardinian</dc:creator>
      <dc:date>2018-07-26T19:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table in SAS without using SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-table-in-SAS-without-using-SQL/m-p/481667#M286786</link>
      <description>&lt;P&gt;For simple statistical analysis like this, do not use the Data Step. Instead use the various procedures available like PROC MEANS, PROC SUMMARY and PROC UNIVARIATE.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A simple google search will get you far in terms of example code.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jul 2018 19:59:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-table-in-SAS-without-using-SQL/m-p/481667#M286786</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-07-26T19:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table in SAS without using SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-table-in-SAS-without-using-SQL/m-p/481669#M286787</link>
      <description>&lt;P&gt;Thank you! But then is it possible to use proc means and proc summary to create a customized table?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jul 2018 20:06:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-table-in-SAS-without-using-SQL/m-p/481669#M286787</guid>
      <dc:creator>kmardinian</dc:creator>
      <dc:date>2018-07-26T20:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a table in SAS without using SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-table-in-SAS-without-using-SQL/m-p/481705#M286788</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/139341"&gt;@kmardinian&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you! But then is it possible to use proc means and proc summary to create a customized table?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;One thing you will have to consider is which type of "table" do you mean? Do you mean a data set such as is used for further analysis or reporting or a simple report from existing data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Procs Mean, Summary, Freq, Tabulate and Report will all do both to some extent.&lt;/P&gt;
&lt;P&gt;For example (your should have the SASHELP.CLASS data set available):&lt;/P&gt;
&lt;PRE&gt;proc means data=sashelp.class n mean max min std lclm uclm;
   class sex;
   var  height weight;
   output out=work.summary;
run;&lt;/PRE&gt;
&lt;P&gt;Will produce a report table in the results window in one format and with the output statement a data set that looks like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Sex    _TYPE_    _FREQ_    _STAT_     Height     Weight

          0        19       N        19.0000     19.000
          0        19       MIN      51.3000     50.500
          0        19       MAX      72.0000    150.000
          0        19       MEAN     62.3368    100.026
          0        19       STD       5.1271     22.774
 F        1         9       N         9.0000      9.000
 F        1         9       MIN      51.3000     50.500
 F        1         9       MAX      66.5000    112.500
 F        1         9       MEAN     60.5889     90.111
 F        1         9       STD       5.0183     19.384
 M        1        10       N        10.0000     10.000
 M        1        10       MIN      57.3000     83.000
 M        1        10       MAX      72.0000    150.000
 M        1        10       MEAN     63.9100    108.950
 M        1        10       STD       4.9379     22.727


&lt;/PRE&gt;
&lt;P&gt;The _type_ variable refers to level(s) of the class variable(s) used; _freq_ is the number of records used, _stat_ indicates which statistic is reported on that line for the variables and the last two columns hold the actual statistic values (excluding the confidence limits as I didn't add all of the syntax needed for that).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In general having a single column with multiple types of data is often considered a poor idea.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The report procedures Tabulate and Report will allow most of the same statistics as Means/Summary and a few others as well plus displaying output in grouped, nested and across behaviors.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jul 2018 22:26:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-table-in-SAS-without-using-SQL/m-p/481705#M286788</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-07-26T22:26:44Z</dc:date>
    </item>
  </channel>
</rss>

