<?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 macro variable creation for use in data set. in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/macro-variable-creation-for-use-in-data-set/m-p/596749#M16008</link>
    <description>&lt;P&gt;I am preparing a data set which I will later add (stack) to another. I have the following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%global lname state;&lt;BR /&gt;%let lname=Churchill;&lt;BR /&gt;%let state=VA;&lt;BR /&gt;data insert;&lt;BR /&gt;LastNamePart=&amp;amp;lname;&lt;BR /&gt;state=&amp;amp;state;&lt;BR /&gt;run;&lt;BR /&gt;proc print; run;&lt;BR /&gt;&lt;BR /&gt;Expected Results are two columns and 1 row&lt;BR /&gt;LastNamePart State&lt;BR /&gt;Churchill VA&lt;BR /&gt;&lt;BR /&gt;I am getting an error that LastNamePart and state are not initialized.&lt;BR /&gt;Proc print is outputing 1 row and 4 variables. &lt;BR /&gt;LastNamePart Churchill State VA&lt;BR /&gt;&lt;BR /&gt;Why? How to fix?&lt;BR /&gt;&lt;BR /&gt;MM&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 16 Oct 2019 05:32:13 GMT</pubDate>
    <dc:creator>MaryA_Marion</dc:creator>
    <dc:date>2019-10-16T05:32:13Z</dc:date>
    <item>
      <title>macro variable creation for use in data set.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/macro-variable-creation-for-use-in-data-set/m-p/596749#M16008</link>
      <description>&lt;P&gt;I am preparing a data set which I will later add (stack) to another. I have the following code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%global lname state;&lt;BR /&gt;%let lname=Churchill;&lt;BR /&gt;%let state=VA;&lt;BR /&gt;data insert;&lt;BR /&gt;LastNamePart=&amp;amp;lname;&lt;BR /&gt;state=&amp;amp;state;&lt;BR /&gt;run;&lt;BR /&gt;proc print; run;&lt;BR /&gt;&lt;BR /&gt;Expected Results are two columns and 1 row&lt;BR /&gt;LastNamePart State&lt;BR /&gt;Churchill VA&lt;BR /&gt;&lt;BR /&gt;I am getting an error that LastNamePart and state are not initialized.&lt;BR /&gt;Proc print is outputing 1 row and 4 variables. &lt;BR /&gt;LastNamePart Churchill State VA&lt;BR /&gt;&lt;BR /&gt;Why? How to fix?&lt;BR /&gt;&lt;BR /&gt;MM&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2019 05:32:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/macro-variable-creation-for-use-in-data-set/m-p/596749#M16008</guid>
      <dc:creator>MaryA_Marion</dc:creator>
      <dc:date>2019-10-16T05:32:13Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable creation for use in data set.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/macro-variable-creation-for-use-in-data-set/m-p/596752#M16010</link>
      <description>&lt;P&gt;When the macro variables are resolved, you get this code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;LastNamePart=Churchill;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The text Churchill is interpreted as a variable name. Add the necessary quotes for string literals to your code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;LastNamePart="&amp;amp;lname";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 16 Oct 2019 05:47:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/macro-variable-creation-for-use-in-data-set/m-p/596752#M16010</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-10-16T05:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: macro variable creation for use in data set.</title>
      <link>https://communities.sas.com/t5/New-SAS-User/macro-variable-creation-for-use-in-data-set/m-p/596753#M16011</link>
      <description>I like your explanation. Otherwise, I look for code to implement without knowing why...Thanks.  MM</description>
      <pubDate>Wed, 16 Oct 2019 05:56:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/macro-variable-creation-for-use-in-data-set/m-p/596753#M16011</guid>
      <dc:creator>MaryA_Marion</dc:creator>
      <dc:date>2019-10-16T05:56:16Z</dc:date>
    </item>
  </channel>
</rss>

