<?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 get number of observation printted in saslist in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-number-of-observation-printted-in-saslist/m-p/5719#M1819</link>
    <description>Hi:&lt;BR /&gt;
  See this previous forum posting for an idea of how macro variable creation works in general:&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=8249‹" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=8249‹&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
  and then study this modification of that previous program:&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc sql;&lt;BR /&gt;
  select count(name)  into :cntobs&lt;BR /&gt;
  from sashelp.class&lt;BR /&gt;
  where age ge 15;&lt;BR /&gt;
quit;&lt;BR /&gt;
      &lt;BR /&gt;
%let cntobs = &amp;amp;cntobs;&lt;BR /&gt;
%put cntobs= &amp;amp;cntobs is the number of obs in SASHELP.CLASS;&lt;BR /&gt;
%put where age was greater than or equal to 15;&lt;BR /&gt;
       &lt;BR /&gt;
ods listing;&lt;BR /&gt;
proc print data=sashelp.class N;&lt;BR /&gt;
title "Students who meet the criteria: &amp;amp;cntobs";&lt;BR /&gt;
  where age ge 15;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
which produces this output:&lt;BR /&gt;
[pre]&lt;BR /&gt;
Students who meet the criteria: 5&lt;BR /&gt;
  &lt;BR /&gt;
Obs    Name       Sex    Age    Height    Weight&lt;BR /&gt;
  &lt;BR /&gt;
  8    Janet       F      15     62.5      112.5&lt;BR /&gt;
 14    Mary        F      15     66.5      112.0&lt;BR /&gt;
 15    Philip      M      16     72.0      150.0&lt;BR /&gt;
 17    Ronald      M      15     67.0      133.0&lt;BR /&gt;
 19    William     M      15     66.5      112.0&lt;BR /&gt;
&lt;BR /&gt;
N = 5&lt;BR /&gt;
&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Note how the number from &amp;amp;CNTOBS used in the title is equal to the N= that is put into the PROC PRINT (after the detail listing).&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
    <pubDate>Tue, 27 Nov 2007 20:02:18 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2007-11-27T20:02:18Z</dc:date>
    <item>
      <title>How to get number of observation printted in saslist</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-number-of-observation-printted-in-saslist/m-p/5718#M1818</link>
      <description>Hi,&lt;BR /&gt;
   i would like to store the number observation printed by PROC PRINT into a macro variable. Could you please let me know how will i get it. For Ex, i want to store the number of OBS for below statement.&lt;BR /&gt;
&lt;BR /&gt;
PROC PRINT DATA=DATA1; WHERE CUST_NAME ='PRABA';RUN;</description>
      <pubDate>Tue, 27 Nov 2007 18:44:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-number-of-observation-printted-in-saslist/m-p/5718#M1818</guid>
      <dc:creator>DPraba79</dc:creator>
      <dc:date>2007-11-27T18:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to get number of observation printted in saslist</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-number-of-observation-printted-in-saslist/m-p/5719#M1819</link>
      <description>Hi:&lt;BR /&gt;
  See this previous forum posting for an idea of how macro variable creation works in general:&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=8249‹" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=8249‹&lt;/A&gt;&lt;BR /&gt;
 &lt;BR /&gt;
  and then study this modification of that previous program:&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc sql;&lt;BR /&gt;
  select count(name)  into :cntobs&lt;BR /&gt;
  from sashelp.class&lt;BR /&gt;
  where age ge 15;&lt;BR /&gt;
quit;&lt;BR /&gt;
      &lt;BR /&gt;
%let cntobs = &amp;amp;cntobs;&lt;BR /&gt;
%put cntobs= &amp;amp;cntobs is the number of obs in SASHELP.CLASS;&lt;BR /&gt;
%put where age was greater than or equal to 15;&lt;BR /&gt;
       &lt;BR /&gt;
ods listing;&lt;BR /&gt;
proc print data=sashelp.class N;&lt;BR /&gt;
title "Students who meet the criteria: &amp;amp;cntobs";&lt;BR /&gt;
  where age ge 15;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
which produces this output:&lt;BR /&gt;
[pre]&lt;BR /&gt;
Students who meet the criteria: 5&lt;BR /&gt;
  &lt;BR /&gt;
Obs    Name       Sex    Age    Height    Weight&lt;BR /&gt;
  &lt;BR /&gt;
  8    Janet       F      15     62.5      112.5&lt;BR /&gt;
 14    Mary        F      15     66.5      112.0&lt;BR /&gt;
 15    Philip      M      16     72.0      150.0&lt;BR /&gt;
 17    Ronald      M      15     67.0      133.0&lt;BR /&gt;
 19    William     M      15     66.5      112.0&lt;BR /&gt;
&lt;BR /&gt;
N = 5&lt;BR /&gt;
&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
Note how the number from &amp;amp;CNTOBS used in the title is equal to the N= that is put into the PROC PRINT (after the detail listing).&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Tue, 27 Nov 2007 20:02:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-get-number-of-observation-printted-in-saslist/m-p/5719#M1819</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2007-11-27T20:02:18Z</dc:date>
    </item>
  </channel>
</rss>

