<?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 create the following data step or macro variable. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-the-following-data-step-or-macro-variable/m-p/280888#M56847</link>
    <description>&lt;P&gt;The SQL into clause could load everything into one macro variable, but I want to group them into different variables based on the ID. Any suggestions?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Jun 2016 19:40:39 GMT</pubDate>
    <dc:creator>Ram_SAS</dc:creator>
    <dc:date>2016-06-28T19:40:39Z</dc:date>
    <item>
      <title>How to create the following data step or macro variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-the-following-data-step-or-macro-variable/m-p/280885#M56845</link>
      <description>&lt;DIV&gt;From the following observations I need to create two variable var101 and var102 (either data step or macro variable).&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;ID&amp;nbsp; &amp;nbsp; &amp;nbsp; numvalue&lt;/DIV&gt;&lt;DIV&gt;101 &amp;nbsp; &amp;nbsp; 23&lt;/DIV&gt;&lt;DIV&gt;101 &amp;nbsp; &amp;nbsp; 27&lt;/DIV&gt;&lt;DIV&gt;101 &amp;nbsp; &amp;nbsp; 29&lt;/DIV&gt;&lt;DIV&gt;101 &amp;nbsp; &amp;nbsp; 22&lt;/DIV&gt;&lt;DIV&gt;102 &amp;nbsp; &amp;nbsp; 23&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;102 &amp;nbsp; &amp;nbsp;32&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=""&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=""&gt;var101 = 23 27 29 &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN class=""&gt;var102 = 22 23 32&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 28 Jun 2016 19:35:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-the-following-data-step-or-macro-variable/m-p/280885#M56845</guid>
      <dc:creator>Ram_SAS</dc:creator>
      <dc:date>2016-06-28T19:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to create the following data step or macro variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-the-following-data-step-or-macro-variable/m-p/280888#M56847</link>
      <description>&lt;P&gt;The SQL into clause could load everything into one macro variable, but I want to group them into different variables based on the ID. Any suggestions?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 19:40:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-the-following-data-step-or-macro-variable/m-p/280888#M56847</guid>
      <dc:creator>Ram_SAS</dc:creator>
      <dc:date>2016-06-28T19:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to create the following data step or macro variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-the-following-data-step-or-macro-variable/m-p/280895#M56849</link>
      <description>&lt;P&gt;Multiple queries? But why?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could also use a data step that concatenates variable and creates macro variable at the end of each group id.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Untested but the gist of the idea is there.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data _null_;
Length var_string $200.;
Set have;

By id;
Retain var_string;
If first.id then call missing(var_string);

Var_string = catt(var_string, value);

If last.id then call symputx('var'|put(id, z3.), var_string);

Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Jun 2016 20:01:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-the-following-data-step-or-macro-variable/m-p/280895#M56849</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-28T20:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to create the following data step or macro variable.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-create-the-following-data-step-or-macro-variable/m-p/280901#M56850</link>
      <description>Awesome ! Thanks for your help !</description>
      <pubDate>Tue, 28 Jun 2016 20:18:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-create-the-following-data-step-or-macro-variable/m-p/280901#M56850</guid>
      <dc:creator>Ram_SAS</dc:creator>
      <dc:date>2016-06-28T20:18:23Z</dc:date>
    </item>
  </channel>
</rss>

