<?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: How to combine a macro variable value and a text string to create a variable in a data step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-combine-a-macro-variable-value-and-a-text-string-to/m-p/515914#M139289</link>
    <description>&lt;P&gt;Most simple method:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data two;
set one;
if b = 'a' then c = "&amp;amp;treat1. respond";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 26 Nov 2018 08:36:47 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-11-26T08:36:47Z</dc:date>
    <item>
      <title>How to combine a macro variable value and a text string to create a variable in a data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-combine-a-macro-variable-value-and-a-text-string-to/m-p/515883#M139271</link>
      <description>&lt;P&gt;Dear,&lt;/P&gt;
&lt;P&gt;I need to help in my code in data step two below. In my actual program i had to create a macro variable using proc sql and use it in a data step similar to below.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In data step two below, i need to create variable 'C' with value='TREATEMENT A Respond'. But i am getting errors. Please help. Thank you&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let treat1=TREATMENT A;
%put &amp;amp;treat1.;
data one;
input a b $;
datalines;
1 a
2 b
;

data two;
set one;
if b='a' then do;
c=&amp;amp;treat1.|| 'respond';
end;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Nov 2018 04:07:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-combine-a-macro-variable-value-and-a-text-string-to/m-p/515883#M139271</guid>
      <dc:creator>knveraraju91</dc:creator>
      <dc:date>2018-11-26T04:07:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine a macro variable value and a text string to create a variable in a data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-combine-a-macro-variable-value-and-a-text-string-to/m-p/515884#M139272</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let treat1=TREATMENT A;
%put &amp;amp;treat1.;
data one;
input a b $;
datalines;
1 a
2 b
;

data two;
set one;
if b='a' then do;
c="&amp;amp;treat1."|| 'respond';
end;run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;Correction was&amp;nbsp;c="&amp;amp;treat1."|| 'respond';&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2018 04:23:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-combine-a-macro-variable-value-and-a-text-string-to/m-p/515884#M139272</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-11-26T04:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine a macro variable value and a text string to create a variable in a data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-combine-a-macro-variable-value-and-a-text-string-to/m-p/515891#M139275</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data two;
set one;
if b='a' then do;
c=catx(' ',"&amp;amp;treat1.","respond");
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You may also use the CATX function.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Nov 2018 05:04:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-combine-a-macro-variable-value-and-a-text-string-to/m-p/515891#M139275</guid>
      <dc:creator>r_behata</dc:creator>
      <dc:date>2018-11-26T05:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine a macro variable value and a text string to create a variable in a data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-combine-a-macro-variable-value-and-a-text-string-to/m-p/515914#M139289</link>
      <description>&lt;P&gt;Most simple method:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data two;
set one;
if b = 'a' then c = "&amp;amp;treat1. respond";
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Nov 2018 08:36:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-combine-a-macro-variable-value-and-a-text-string-to/m-p/515914#M139289</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-11-26T08:36:47Z</dc:date>
    </item>
  </channel>
</rss>

