<?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: Selecting multiple variables in PROC SQL, but only creating one macro variable with into clause in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Selecting-multiple-variables-in-PROC-SQL-but-only-creating-one/m-p/415852#M102063</link>
    <description>&lt;P&gt;I really don't understand your question.&amp;nbsp; If you only want one macro variable, then only select one data item:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;sql&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token statement"&gt;  select&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;count&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token keyword"&gt;distinct&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;ID&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; 
&lt;SPAN class="token keyword"&gt;  into&lt;/SPAN&gt; :nobs
&lt;SPAN class="token keyword"&gt;  from&lt;/SPAN&gt; Have&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;quit&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Nov 2017 15:38:29 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-11-23T15:38:29Z</dc:date>
    <item>
      <title>Selecting multiple variables in PROC SQL, but only creating one macro variable with into clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-multiple-variables-in-PROC-SQL-but-only-creating-one/m-p/415850#M102061</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Quick question for you guys: I basically want to create a macro variable called syserr1 that if greater than 0 will give me an error message in an other code.&lt;/P&gt;&lt;P&gt;Now, the code below creates my macro variable no problem, &lt;STRONG&gt;I was just wondering if it was possible to create ONLY one macro variable in my procedure instead of 3&lt;/STRONG&gt;? (AKA no need to create &amp;amp;nobs and &amp;amp;nuniqid&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	select count(distinct ID) as Nuniq, count(*) as Nobs, calculated Nobs - calculated Nuniq as diff 
	into :nobs, :nuniqid, :syserr1
		from Have
	;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 15:33:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-multiple-variables-in-PROC-SQL-but-only-creating-one/m-p/415850#M102061</guid>
      <dc:creator>x2PSx</dc:creator>
      <dc:date>2017-11-23T15:33:59Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting multiple variables in PROC SQL, but only creating one macro variable with into clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-multiple-variables-in-PROC-SQL-but-only-creating-one/m-p/415852#M102063</link>
      <description>&lt;P&gt;I really don't understand your question.&amp;nbsp; If you only want one macro variable, then only select one data item:&lt;/P&gt;
&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;sql&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token statement"&gt;  select&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;count&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token keyword"&gt;distinct&lt;/SPAN&gt; &lt;SPAN class="token keyword"&gt;ID&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; 
&lt;SPAN class="token keyword"&gt;  into&lt;/SPAN&gt; :nobs
&lt;SPAN class="token keyword"&gt;  from&lt;/SPAN&gt; Have&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;quit&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Nov 2017 15:38:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-multiple-variables-in-PROC-SQL-but-only-creating-one/m-p/415852#M102063</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-11-23T15:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting multiple variables in PROC SQL, but only creating one macro variable with into clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-multiple-variables-in-PROC-SQL-but-only-creating-one/m-p/415855#M102065</link>
      <description>The macro variable that I need is the difference between the unique observations and the total number of observations. My third variable in the select clause creates this variable and is the only one that I need.</description>
      <pubDate>Thu, 23 Nov 2017 15:44:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-multiple-variables-in-PROC-SQL-but-only-creating-one/m-p/415855#M102065</guid>
      <dc:creator>x2PSx</dc:creator>
      <dc:date>2017-11-23T15:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting multiple variables in PROC SQL, but only creating one macro variable with into clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-multiple-variables-in-PROC-SQL-but-only-creating-one/m-p/415859#M102068</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	select count(*) - count(distinct ID) into :syserr1
		from Have
	;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 23 Nov 2017 15:57:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-multiple-variables-in-PROC-SQL-but-only-creating-one/m-p/415859#M102068</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-11-23T15:57:49Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting multiple variables in PROC SQL, but only creating one macro variable with into clause</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Selecting-multiple-variables-in-PROC-SQL-but-only-creating-one/m-p/415861#M102070</link>
      <description>I knew it was gonna be easy... Wow. Thank you very much for response time, Good day to you!</description>
      <pubDate>Thu, 23 Nov 2017 16:01:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Selecting-multiple-variables-in-PROC-SQL-but-only-creating-one/m-p/415861#M102070</guid>
      <dc:creator>x2PSx</dc:creator>
      <dc:date>2017-11-23T16:01:47Z</dc:date>
    </item>
  </channel>
</rss>

