<?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 Multiple macro variable: PROC SQL select into does not work as expected in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Multiple-macro-variable-PROC-SQL-select-into-does-not-work-as/m-p/675646#M203590</link>
    <description>&lt;P&gt;Hi SAS experts,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the below codes, I don't understand why &amp;amp;varlist only catched “height”, and low only catched '1'.&amp;nbsp;It supposed to be "height weight" for &amp;amp;varlist; and "1.0 25" for &amp;amp;lowlist. Any thoughts would be appreciated!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance~&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
	input var $ low high;
	cards;
height 1.0 2.0
weight 25  200
;
run;
proc sql;
	select Var, low, high into:varlist,:lowlist,:highlist separated by ' '
	from a;
quit;
%put varlist: &amp;amp;varlist ---
	 lowlist: &amp;amp;lowlist ---
	 highlist:&amp;amp;highlist;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2020-08-11_000624.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/48097iD21FEE741B27DB0C/image-size/large?v=v2&amp;amp;px=999" role="button" title="2020-08-11_000624.jpg" alt="2020-08-11_000624.jpg" /&gt;&lt;/span&gt;&lt;/CODE&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Aug 2020 16:08:44 GMT</pubDate>
    <dc:creator>Cecillia_Mao</dc:creator>
    <dc:date>2020-08-10T16:08:44Z</dc:date>
    <item>
      <title>Multiple macro variable: PROC SQL select into does not work as expected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-macro-variable-PROC-SQL-select-into-does-not-work-as/m-p/675646#M203590</link>
      <description>&lt;P&gt;Hi SAS experts,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the below codes, I don't understand why &amp;amp;varlist only catched “height”, and low only catched '1'.&amp;nbsp;It supposed to be "height weight" for &amp;amp;varlist; and "1.0 25" for &amp;amp;lowlist. Any thoughts would be appreciated!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance~&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
	input var $ low high;
	cards;
height 1.0 2.0
weight 25  200
;
run;
proc sql;
	select Var, low, high into:varlist,:lowlist,:highlist separated by ' '
	from a;
quit;
%put varlist: &amp;amp;varlist ---
	 lowlist: &amp;amp;lowlist ---
	 highlist:&amp;amp;highlist;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2020-08-11_000624.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/48097iD21FEE741B27DB0C/image-size/large?v=v2&amp;amp;px=999" role="button" title="2020-08-11_000624.jpg" alt="2020-08-11_000624.jpg" /&gt;&lt;/span&gt;&lt;/CODE&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2020 16:08:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-macro-variable-PROC-SQL-select-into-does-not-work-as/m-p/675646#M203590</guid>
      <dc:creator>Cecillia_Mao</dc:creator>
      <dc:date>2020-08-10T16:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple macro variable: PROC SQL select into does not work as expected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-macro-variable-PROC-SQL-select-into-does-not-work-as/m-p/675652#M203591</link>
      <description>&lt;P&gt;Note that it does work for the last entry.&lt;/P&gt;
&lt;P&gt;The portion of code "&amp;nbsp;&lt;FONT color="#800080"&gt;&lt;STRONG&gt;separated by ' '&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;" is only applied to the last set of items which is why that one shows correctly. Specify it for every list if you want to store multiple items in each list, otherwise it stores only the first value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	select Var, low, high into
	:varlist separated by " ",
	:lowlist separated by " ",
	:highlist separated by ' '
	from a;
quit;
%put varlist: &amp;amp;varlist ---
	 lowlist: &amp;amp;lowlist ---
	 highlist:&amp;amp;highlist;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/275960"&gt;@Cecillia_Mao&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi SAS experts,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the below codes, I don't understand why &amp;amp;varlist only catched “height”, and low only catched '1'.&amp;nbsp;It supposed to be "height weight" for &amp;amp;varlist; and "1.0 25" for &amp;amp;lowlist. Any thoughts would be appreciated!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance~&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
	input var $ low high;
	cards;
height 1.0 2.0
weight 25  200
;
run;
proc sql;
	select Var, low, high into:varlist,:lowlist,:highlist separated by ' '
	from a;
quit;
%put varlist: &amp;amp;varlist ---
	 lowlist: &amp;amp;lowlist ---
	 highlist:&amp;amp;highlist;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2020-08-11_000624.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/48097iD21FEE741B27DB0C/image-size/large?v=v2&amp;amp;px=999" role="button" title="2020-08-11_000624.jpg" alt="2020-08-11_000624.jpg" /&gt;&lt;/span&gt;&lt;/CODE&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2020 16:20:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-macro-variable-PROC-SQL-select-into-does-not-work-as/m-p/675652#M203591</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-08-10T16:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple macro variable: PROC SQL select into does not work as expected</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Multiple-macro-variable-PROC-SQL-select-into-does-not-work-as/m-p/675802#M203650</link>
      <description>Thank you! That works perfectly!</description>
      <pubDate>Tue, 11 Aug 2020 01:17:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Multiple-macro-variable-PROC-SQL-select-into-does-not-work-as/m-p/675802#M203650</guid>
      <dc:creator>Cecillia_Mao</dc:creator>
      <dc:date>2020-08-11T01:17:46Z</dc:date>
    </item>
  </channel>
</rss>

