<?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 How to numerate values into a list of macro variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-numerate-values-into-a-list-of-macro-variables/m-p/952743#M372330</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a list of values as below and want to assign macro variables &lt;STRONG&gt;(num_val&amp;amp;i.) &lt;/STRONG&gt;like num_val1 for 0.5, num_val2 for 0.9, ... num_val5 for 2. Can anyone help me out? Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data have;&lt;BR /&gt;infile datalines truncover dsd;&lt;BR /&gt;input num_val;&lt;BR /&gt;datalines;&lt;BR /&gt;0.5&lt;BR /&gt;0.9&lt;BR /&gt;1.1&lt;BR /&gt;1.5&lt;BR /&gt;2&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Dec 2024 13:36:02 GMT</pubDate>
    <dc:creator>lichee</dc:creator>
    <dc:date>2024-12-06T13:36:02Z</dc:date>
    <item>
      <title>How to numerate values into a list of macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-numerate-values-into-a-list-of-macro-variables/m-p/952743#M372330</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a list of values as below and want to assign macro variables &lt;STRONG&gt;(num_val&amp;amp;i.) &lt;/STRONG&gt;like num_val1 for 0.5, num_val2 for 0.9, ... num_val5 for 2. Can anyone help me out? Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data have;&lt;BR /&gt;infile datalines truncover dsd;&lt;BR /&gt;input num_val;&lt;BR /&gt;datalines;&lt;BR /&gt;0.5&lt;BR /&gt;0.9&lt;BR /&gt;1.1&lt;BR /&gt;1.5&lt;BR /&gt;2&lt;BR /&gt;;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2024 13:36:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-numerate-values-into-a-list-of-macro-variables/m-p/952743#M372330</guid>
      <dc:creator>lichee</dc:creator>
      <dc:date>2024-12-06T13:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to numerate values into a list of macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-numerate-values-into-a-list-of-macro-variables/m-p/952744#M372331</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
   select num_val into :num_val1 -
   from have
   ;
quit;

%put &amp;amp;=num_val1.;
%put &amp;amp;=num_val2.;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Dec 2024 13:42:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-numerate-values-into-a-list-of-macro-variables/m-p/952744#M372331</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2024-12-06T13:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to numerate values into a list of macro variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-numerate-values-into-a-list-of-macro-variables/m-p/952745#M372332</link>
      <description>&lt;P&gt;In general, I am skeptical that this is a good approach. Can you please share with us what you will do with these macro variables once they are created, that cannot be done using data set HAVE?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, here is the code you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
    set have;
    call symputx(cats('num_val',_n_),num_val);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Dec 2024 13:44:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-numerate-values-into-a-list-of-macro-variables/m-p/952745#M372332</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-12-06T13:44:36Z</dc:date>
    </item>
  </channel>
</rss>

