<?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: call variables using a macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/call-variables-using-a-macro/m-p/311337#M67263</link>
    <description>&lt;P&gt;Like this? Have simply dropped the ""..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input dataset_201610 dataset_201609;
datalines;
10 5
20 1
;

%let current = 201610;
%let prev    = 201609;

data want;
   set have;
   newvar = dataset_&amp;amp;current-dataset_&amp;amp;prev;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 14 Nov 2016 07:41:45 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2016-11-14T07:41:45Z</dc:date>
    <item>
      <title>call variables using a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-variables-using-a-macro/m-p/311336#M67262</link>
      <description>&lt;P&gt;Dear Expert,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I should do a calculation calculate the difference between two variables:&lt;/P&gt;&lt;P&gt;- dataset_201610&lt;/P&gt;&lt;P&gt;- dataset 201609&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;starting from the point that:&lt;/P&gt;&lt;P&gt;&amp;amp;current.=201610&lt;/P&gt;&lt;P&gt;&amp;amp;prev.=201609&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I flexibly specify the columns using something like:&lt;/P&gt;&lt;P&gt;data_set_"&amp;amp;current."-&lt;SPAN&gt;data_set_"&amp;amp;prev."?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks a lot in advance,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SH&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2016 07:30:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-variables-using-a-macro/m-p/311336#M67262</guid>
      <dc:creator>Sir_Highbury</dc:creator>
      <dc:date>2016-11-14T07:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: call variables using a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/call-variables-using-a-macro/m-p/311337#M67263</link>
      <description>&lt;P&gt;Like this? Have simply dropped the ""..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input dataset_201610 dataset_201609;
datalines;
10 5
20 1
;

%let current = 201610;
%let prev    = 201609;

data want;
   set have;
   newvar = dataset_&amp;amp;current-dataset_&amp;amp;prev;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Nov 2016 07:41:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/call-variables-using-a-macro/m-p/311337#M67263</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2016-11-14T07:41:45Z</dc:date>
    </item>
  </channel>
</rss>

