<?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: input record count from another table in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/input-record-count-from-another-table/m-p/572206#M12285</link>
    <description>&lt;P&gt;thanks!! But what if my table1 also has some character values? I don't think proc summary works in that case.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jul 2019 19:14:54 GMT</pubDate>
    <dc:creator>laiguanyu001</dc:creator>
    <dc:date>2019-07-09T19:14:54Z</dc:date>
    <item>
      <title>input record count from another table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/input-record-count-from-another-table/m-p/572184#M12282</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create a dataset that looks like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data out;&lt;/P&gt;&lt;P&gt;input id description $ num_of_errors error $;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1001 some_string &amp;amp;count_of_record some_error&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;data table1;&lt;/P&gt;&lt;P&gt;input test;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;3&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here I want &amp;amp;count_of_record to be the number of rows from table1. so when I print the data out,&lt;/P&gt;&lt;P&gt;the result will look like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;id&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; description&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;num_of_error&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;error&lt;/P&gt;&lt;P&gt;1001&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; some_string&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; some_error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm wondering if there's a programming way to do this instead of manually type in. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 18:27:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/input-record-count-from-another-table/m-p/572184#M12282</guid>
      <dc:creator>laiguanyu001</dc:creator>
      <dc:date>2019-07-09T18:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: input record count from another table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/input-record-count-from-another-table/m-p/572188#M12284</link>
      <description>&lt;P&gt;No macro needed. Basic manipulation of data rarely requires macros.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=table1;
    var test;
    output out=ntable n=num_of_errors;
run;

data out;
    if _n_=1 then set ntable(drop=_:);
    input id description $ error $;
    datalines;
...
;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also, you can't have macro variables inside DATALINES&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 18:44:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/input-record-count-from-another-table/m-p/572188#M12284</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-07-09T18:44:58Z</dc:date>
    </item>
    <item>
      <title>Re: input record count from another table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/input-record-count-from-another-table/m-p/572206#M12285</link>
      <description>&lt;P&gt;thanks!! But what if my table1 also has some character values? I don't think proc summary works in that case.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 19:14:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/input-record-count-from-another-table/m-p/572206#M12285</guid>
      <dc:creator>laiguanyu001</dc:creator>
      <dc:date>2019-07-09T19:14:54Z</dc:date>
    </item>
    <item>
      <title>Re: input record count from another table</title>
      <link>https://communities.sas.com/t5/New-SAS-User/input-record-count-from-another-table/m-p/572210#M12286</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/279765"&gt;@laiguanyu001&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;But what if my table1 also has some character values?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Llittle known fact, if you omit the VAR command, PROC SUMMARY will count the number of observations, even if there are only character variables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=have;
	output out=_stats_ ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 19:23:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/input-record-count-from-another-table/m-p/572210#M12286</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-07-09T19:23:24Z</dc:date>
    </item>
  </channel>
</rss>

