<?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 Loop through a list and create a dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Loop-through-a-list-and-create-a-dataset/m-p/555113#M154468</link>
    <description>&lt;P&gt;Hi SAS Users,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a global macro which contains a list of values in which the order they appear represent the order they should appear in the dataset.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%let values = A, C, D, Z;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;I want to loop through the list and create a dataset similar to this. I want this to be a dynamic dataset that updates itself when a new list is added.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Values order&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A&amp;nbsp; 1&lt;/P&gt;
&lt;P&gt;C 2&lt;/P&gt;
&lt;P&gt;D 3&lt;/P&gt;
&lt;P&gt;Z 4&lt;/P&gt;</description>
    <pubDate>Tue, 30 Apr 2019 16:20:05 GMT</pubDate>
    <dc:creator>zqkal</dc:creator>
    <dc:date>2019-04-30T16:20:05Z</dc:date>
    <item>
      <title>Loop through a list and create a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Loop-through-a-list-and-create-a-dataset/m-p/555113#M154468</link>
      <description>&lt;P&gt;Hi SAS Users,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a global macro which contains a list of values in which the order they appear represent the order they should appear in the dataset.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%let values = A, C, D, Z;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;I want to loop through the list and create a dataset similar to this. I want this to be a dynamic dataset that updates itself when a new list is added.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Values order&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A&amp;nbsp; 1&lt;/P&gt;
&lt;P&gt;C 2&lt;/P&gt;
&lt;P&gt;D 3&lt;/P&gt;
&lt;P&gt;Z 4&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2019 16:20:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Loop-through-a-list-and-create-a-dataset/m-p/555113#M154468</guid>
      <dc:creator>zqkal</dc:creator>
      <dc:date>2019-04-30T16:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Loop through a list and create a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Loop-through-a-list-and-create-a-dataset/m-p/555117#M154469</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%let values = A, C, D, Z; 


data want;
do order=1 to countw("&amp;amp;values",',');
values=scan("&amp;amp;values",order,',');
output;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Apr 2019 16:27:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Loop-through-a-list-and-create-a-dataset/m-p/555117#M154469</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-04-30T16:27:42Z</dc:date>
    </item>
  </channel>
</rss>

