<?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 macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro/m-p/500980#M133501</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wanted to ask how can edit this code to run without error&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro count_pt ;

	proc sql;
		select count(distinct patient_id), count (*) 
			into:patients trimmed into:obs
		from  &amp;amp;syslast. ;
	quit ;
	
	%put There are &amp;amp;patients. and &amp;amp;obs. from &amp;amp;syslast. ; 
	
%mend count_pt ;
%count_pt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Oct 2018 22:11:51 GMT</pubDate>
    <dc:creator>manya92</dc:creator>
    <dc:date>2018-10-02T22:11:51Z</dc:date>
    <item>
      <title>macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro/m-p/500980#M133501</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hi all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wanted to ask how can edit this code to run without error&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro count_pt ;

	proc sql;
		select count(distinct patient_id), count (*) 
			into:patients trimmed into:obs
		from  &amp;amp;syslast. ;
	quit ;
	
	%put There are &amp;amp;patients. and &amp;amp;obs. from &amp;amp;syslast. ; 
	
%mend count_pt ;
%count_pt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 22:11:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro/m-p/500980#M133501</guid>
      <dc:creator>manya92</dc:creator>
      <dc:date>2018-10-02T22:11:51Z</dc:date>
    </item>
    <item>
      <title>Re: macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro/m-p/500983#M133504</link>
      <description>&lt;P&gt;You should be able to reorganize one line:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;into : patients trimmed, : obs&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 22:15:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro/m-p/500983#M133504</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-10-02T22:15:53Z</dc:date>
    </item>
    <item>
      <title>Re: macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro/m-p/501202#M133608</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/208127"&gt;@manya92&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;hi all,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I wanted to ask how can edit this code to run without error&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro count_pt ;

	proc sql;
		select count(distinct patient_id), count (*) 
			into:patients trimmed into:obs
		from  &amp;amp;syslast. ;
	quit ;
	
	%put There are &amp;amp;patients. and &amp;amp;obs. from &amp;amp;syslast. ; 
	
%mend count_pt ;
%count_pt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I would be very hesitant to say a macro that relies on referencing the last created data set for input and mentioning specific variables could ever be made to run "without errors" without providing code to check that the variables used exist in the data set. At which point you may need to have some code outside of this macro to modify following code behavior when the &amp;amp;syslast data set does not contain the patient_id variable.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Oct 2018 16:33:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro/m-p/501202#M133608</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-10-03T16:33:05Z</dc:date>
    </item>
  </channel>
</rss>

