<?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 to print count in a field? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-print-count-in-a-field/m-p/502362#M134100</link>
    <description>&lt;P&gt;Something like:&lt;/P&gt;
&lt;PRE&gt;proc print data=sashelp.vtable;
  var nobs;
  where libname="&amp;lt;yourlib&amp;gt;" and memname="&amp;lt;yourds&amp;gt;";
run;&lt;/PRE&gt;
&lt;P&gt;Note that &amp;lt;yourlib&amp;gt; and &amp;lt;yourds&amp;gt; need to be replaced with your library and dataset names (note most probably in upper case!).&lt;/P&gt;</description>
    <pubDate>Mon, 08 Oct 2018 12:01:00 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-10-08T12:01:00Z</dc:date>
    <item>
      <title>How to print count in a field?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-print-count-in-a-field/m-p/502342#M134090</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to print a count (no. of observations) of a file in a particular field.&lt;/P&gt;&lt;P&gt;How I can achieve that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;Can I use NOOBS to print in any new field?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 10:48:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-print-count-in-a-field/m-p/502342#M134090</guid>
      <dc:creator>SASInd</dc:creator>
      <dc:date>2018-10-08T10:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to print count in a field?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-print-count-in-a-field/m-p/502345#M134091</link>
      <description>&lt;P&gt;Please supply some example data (in a data step with datalines), and what you expect out of it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;noobs is an option for proc print. It will &lt;EM&gt;print&lt;/EM&gt; the observation number in the output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to create a simple observation count, use _n_ in a data step.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 11:16:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-print-count-in-a-field/m-p/502345#M134091</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-10-08T11:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to print count in a field?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-print-count-in-a-field/m-p/502346#M134092</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm a little unclear about what you mean by "particular field" and "any new field"; I have assumed that by "file"&amp;nbsp;you mean "SAS data set". Are you trying to create a separate SAS data set that contains the count of observations from another SAS data set? Do you just want to see the count displayed in the log? E.g.:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   put count =;
   set sashelp.class(obs=0) nobs = count;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please clarify what you require, thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 11:16:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-print-count-in-a-field/m-p/502346#M134092</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2018-10-08T11:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to print count in a field?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-print-count-in-a-field/m-p/502358#M134099</link>
      <description>&lt;P&gt;My file has 5000+ records and I want this no. to be printed in a new file with the records count.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 11:49:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-print-count-in-a-field/m-p/502358#M134099</guid>
      <dc:creator>SASInd</dc:creator>
      <dc:date>2018-10-08T11:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to print count in a field?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-print-count-in-a-field/m-p/502362#M134100</link>
      <description>&lt;P&gt;Something like:&lt;/P&gt;
&lt;PRE&gt;proc print data=sashelp.vtable;
  var nobs;
  where libname="&amp;lt;yourlib&amp;gt;" and memname="&amp;lt;yourds&amp;gt;";
run;&lt;/PRE&gt;
&lt;P&gt;Note that &amp;lt;yourlib&amp;gt; and &amp;lt;yourds&amp;gt; need to be replaced with your library and dataset names (note most probably in upper case!).&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 12:01:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-print-count-in-a-field/m-p/502362#M134100</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-10-08T12:01:00Z</dc:date>
    </item>
  </channel>
</rss>

