<?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: create a list of yeas in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/create-a-list-of-yeas/m-p/850939#M41916</link>
    <description>&lt;P&gt;There are better ways to organize data than putting year values into variable names. A long data set will be much easier to work with in the long run, as almost all SAS PROCs are designed to work with long data sets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please tell us the goal of doing this, what analysis or report will you be doing with this data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This seems like a great example of the &lt;A href="https://en.wikipedia.org/wiki/XY_problem" target="_self"&gt;XY problem&lt;/A&gt;, never a good place to be.&lt;/P&gt;</description>
    <pubDate>Fri, 23 Dec 2022 12:08:42 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-12-23T12:08:42Z</dc:date>
    <item>
      <title>create a list of yeas</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/create-a-list-of-yeas/m-p/850932#M41914</link>
      <description>&lt;P&gt;Hello SAS folks,&lt;/P&gt;&lt;P&gt;I am trying to automate a list of dates, having as input the starting year and the ending year.&lt;/P&gt;&lt;P&gt;I have this:&lt;/P&gt;&lt;P&gt;%LET ain=2007;&lt;/P&gt;&lt;P&gt;%LET afi=2022; (every year I want to update this year)&lt;/P&gt;&lt;P&gt;I would like to create a list to insert it in the "retain" command:&lt;/P&gt;&lt;P&gt;retain _name_ _2004 _2005 _2006 _2007 _2004_2007 _2009 _2010 _2011 _2012 _2013 _2014 _2015 _2016 _2017 _2018 _2019 _2020;&lt;/P&gt;&lt;P&gt;So the ideal thing would be to have something like this:&lt;/P&gt;&lt;P&gt;retain _name_ &amp;amp;listofyears;&lt;/P&gt;&lt;P&gt;I am not able to create that macrovariable %listofyears.&lt;/P&gt;&lt;P&gt;Thanks in advance fot your help.&lt;/P&gt;&lt;P&gt;Ale&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 11:24:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/create-a-list-of-yeas/m-p/850932#M41914</guid>
      <dc:creator>alecav76</dc:creator>
      <dc:date>2022-12-23T11:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: create a list of yeas</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/create-a-list-of-yeas/m-p/850934#M41915</link>
      <description>&lt;P&gt;Something like below should do.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%LET ain=2007;
%LET afi=2022;
%macro yr_list(start,stop);
  %global listofyears;
  %let listofyears=;
  %do i=&amp;amp;start %to &amp;amp;stop;
    %let listofyears=&amp;amp;listofyears _&amp;amp;i;
  %end;
%mend;
%yr_list(&amp;amp;ain,&amp;amp;afi);

data sample;
  retain _name_ &amp;amp;listofyears;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Dec 2022 11:32:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/create-a-list-of-yeas/m-p/850934#M41915</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-12-23T11:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: create a list of yeas</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/create-a-list-of-yeas/m-p/850939#M41916</link>
      <description>&lt;P&gt;There are better ways to organize data than putting year values into variable names. A long data set will be much easier to work with in the long run, as almost all SAS PROCs are designed to work with long data sets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please tell us the goal of doing this, what analysis or report will you be doing with this data?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This seems like a great example of the &lt;A href="https://en.wikipedia.org/wiki/XY_problem" target="_self"&gt;XY problem&lt;/A&gt;, never a good place to be.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 12:08:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/create-a-list-of-yeas/m-p/850939#M41916</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-12-23T12:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: create a list of yeas</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/create-a-list-of-yeas/m-p/850945#M41917</link>
      <description>Thanks! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Fri, 23 Dec 2022 13:08:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/create-a-list-of-yeas/m-p/850945#M41917</guid>
      <dc:creator>alecav76</dc:creator>
      <dc:date>2022-12-23T13:08:49Z</dc:date>
    </item>
  </channel>
</rss>

