<?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: Defining %let inside %let in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Defining-let-inside-let/m-p/703301#M26002</link>
    <description>&lt;P&gt;Each %LET must be terminated properly. To combine several macro statements, use the same technique used in data step programming (DO-END):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if &amp;amp;year = 2020 %then %do;
   %let ID = 1234;
   %let ID_TM1 = 5678;
   %let ID_LIST = (9012, 3456, 7890);
%end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 03 Dec 2020 08:52:39 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-12-03T08:52:39Z</dc:date>
    <item>
      <title>Defining %let inside %let</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Defining-let-inside-let/m-p/703299#M26000</link>
      <description>&lt;P&gt;Hello everyone&lt;/P&gt;&lt;P&gt;I am just getting started with macros and have been using %let for a while now. Put simply, in my program I want to have a %let command to invoke further %let commands. I want to be able to enter a relatively simple variable (i.e. year) and call other variables that are harder to remember (ID's), but which are always related. So that every year has a specific ID. Currently I am using it like this and it works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let year = 2020;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let ID = 1234;&lt;BR /&gt;%let ID_TM1 = 5678;&lt;/P&gt;&lt;P&gt;%let ID_LIST = (9012, 3456, 7890);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this requires me to look up the IDs every time I want to run another year. So, I want to look it something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let year = 2020;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%if &amp;amp;year = 2020 %then&lt;BR /&gt;&amp;nbsp;&amp;nbsp; %let ID = 1234&lt;BR /&gt;&amp;nbsp;&amp;nbsp; %let ID_TM1 = 5678&lt;BR /&gt;&amp;nbsp;&amp;nbsp; %let ID_LIST = (9012, 3456, 7890);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This however produces the error 49, which I do not understand since there are no opening brackets.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2020 08:35:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Defining-let-inside-let/m-p/703299#M26000</guid>
      <dc:creator>skgel</dc:creator>
      <dc:date>2020-12-03T08:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: Defining %let inside %let</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Defining-let-inside-let/m-p/703301#M26002</link>
      <description>&lt;P&gt;Each %LET must be terminated properly. To combine several macro statements, use the same technique used in data step programming (DO-END):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%if &amp;amp;year = 2020 %then %do;
   %let ID = 1234;
   %let ID_TM1 = 5678;
   %let ID_LIST = (9012, 3456, 7890);
%end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Dec 2020 08:52:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Defining-let-inside-let/m-p/703301#M26002</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-12-03T08:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: Defining %let inside %let</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Defining-let-inside-let/m-p/703325#M26004</link>
      <description>Thank you very much!</description>
      <pubDate>Thu, 03 Dec 2020 10:21:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Defining-let-inside-let/m-p/703325#M26004</guid>
      <dc:creator>skgel</dc:creator>
      <dc:date>2020-12-03T10:21:44Z</dc:date>
    </item>
  </channel>
</rss>

