<?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: Macro for multiple values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-multiple-values/m-p/794748#M254835</link>
    <description>&lt;P&gt;Do you want the values in separate macro variables or in one macro variable?&lt;/P&gt;</description>
    <pubDate>Mon, 07 Feb 2022 09:11:28 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2022-02-07T09:11:28Z</dc:date>
    <item>
      <title>Macro for multiple values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-multiple-values/m-p/794747#M254834</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
 select name,sex,age into  :n  seperated by ', ' from sashelp.class
 where name='William';
quit;

%put &amp;amp;=n. ;
%put &amp;amp;=a. ;
%put &amp;amp;=b. ;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I want&amp;nbsp; name ,sex and age values in log window&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 08:51:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-multiple-values/m-p/794747#M254834</guid>
      <dc:creator>BrahmanandaRao</dc:creator>
      <dc:date>2022-02-07T08:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for multiple values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-multiple-values/m-p/794748#M254835</link>
      <description>&lt;P&gt;Do you want the values in separate macro variables or in one macro variable?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 09:11:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-multiple-values/m-p/794748#M254835</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-02-07T09:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for multiple values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-multiple-values/m-p/794764#M254846</link>
      <description>&lt;P&gt;I assume what you want is something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
 select name,sex,age into  :n,:s,:a from sashelp.class
 where name='William';
quit;

%put &amp;amp;=n. ;
%put &amp;amp;=a. ;
%put &amp;amp;=b. ;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I put in the NOPRINT option for the procedure, as I assume you do not want the print as well as the log lines.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The guide to SELECT ... INTO is &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/sqlproc/n1tupenuhmu1j0n19d3curl9igt4.htm" target="_self"&gt;here&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 11:06:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-multiple-values/m-p/794764#M254846</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2022-02-07T11:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for multiple values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-multiple-values/m-p/794768#M254850</link>
      <description>&lt;P&gt;Storing data in macro-variables almost always leads to unnecessary difficult code. So, because i am curious, what are the next steps?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 11:31:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-multiple-values/m-p/794768#M254850</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-02-07T11:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for multiple values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-multiple-values/m-p/794772#M254853</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
 select name,sex,age into  :n  seperated by ', ' from sashelp.class
 where name='William';
quit;

%put &amp;amp;=n. ;
%put &amp;amp;=a. ;
%put &amp;amp;=b. ;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I want&amp;nbsp; name ,sex and age values in log window&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Others have given valuable advice.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;, from now on let's get the terminology correct so we can all avoid confusion. You are not talking about a "macro". You are talking about macro variables. Do not call macro variables by the name "macro". A macro is something different.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 12:05:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-multiple-values/m-p/794772#M254853</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-02-07T12:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for multiple values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-multiple-values/m-p/794824#M254875</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/265860"&gt;@BrahmanandaRao&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
 select name,sex,age into  :n  seperated by ', ' from sashelp.class
 where name='William';
quit;

%put &amp;amp;=n. ;
%put &amp;amp;=a. ;
%put &amp;amp;=b. ;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I want&amp;nbsp; name ,sex and age values in log window&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;PRE&gt;data _null_;
   set sashelp.class;
   put name sex age;
run;&lt;/PRE&gt;
&lt;P&gt;SQL does not write much to the log. The data step Put statement will unless you provide a target File. Or use the PUTLOG statement to limit output to the log only.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Feb 2022 16:18:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-multiple-values/m-p/794824#M254875</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-02-07T16:18:22Z</dc:date>
    </item>
  </channel>
</rss>

