<?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: Macro variable not resolving in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194544#M36577</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My guess is that you aren't selecting any values into your macro variables. The PERCENT column in the output table is not in decimal form so, 45.55% is not .4555 but 45.55. You are selecting "if &amp;lt;= 0.01" which would be 1% if it were in decimal form but is actually .0001% in the values that show up in the PERCENT column. I doubt you have any values that small so nothing is read into your macro variables. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Jul 2015 15:53:37 GMT</pubDate>
    <dc:creator>Scott_C_Moore</dc:creator>
    <dc:date>2015-07-02T15:53:37Z</dc:date>
    <item>
      <title>Macro variable not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194542#M36575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am building a macro in which i am trying to collapse categories of a categorical variable. All the categories of a variable having less than 5% would be combined into one and name the label with their categories names' separated by"_". The problem arises in IF THEN statement using macro variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc freq data=def;&lt;/P&gt;&lt;P&gt;table DSTRCT_Code / out= abcd;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL NOPRINT;&lt;/P&gt;&lt;P&gt;Select catt("'",DSTRCT_Code, "'") INTO : charvarname separated by ","&lt;/P&gt;&lt;P&gt;from abcd&lt;/P&gt;&lt;P&gt;having PERCENT &amp;lt;= 0.01 and DSTRCT_Code is not null;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL NOPRINT;&lt;/P&gt;&lt;P&gt;Select DSTRCT_Code INTO : charvarname2 separated by "_"&lt;/P&gt;&lt;P&gt;from abcd&lt;/P&gt;&lt;P&gt;having PERCENT &amp;lt;= 0.01 and DSTRCT_Code is not null;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put &amp;amp;charvarname.;&lt;/P&gt;&lt;P&gt;%put &amp;amp;charvarname2.;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options symbolgen mlogic;&lt;/P&gt;&lt;P&gt;data def;&lt;/P&gt;&lt;P&gt;length DSTRCT_Code_NEW $32.;&lt;/P&gt;&lt;P&gt;set def;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;if DSTRCT_Code in(&amp;amp;charvarname.) then DSTRCT_Code_NEW = &amp;amp;charvarname2.;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;else DSTRCT_Code_NEW = DSTRCT_Code;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above highlighted code returns missing values in DSTRCT_Code. Also i need to make sure if the variable name exceeds 32 characters, it should truncate macro variable upto 32 characters. For example, a variable named" District_Code" having categories A, B and C needs to be combined. So the new variable would be created and named "District_code_NEW" would have a category - "A_B_C" against &lt;SPAN style="font-size: 13.3333330154419px;"&gt; A, B and C categories of District_Code&lt;/SPAN&gt;. Otherwise, same value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in anticipation!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2015 15:13:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194542#M36575</guid>
      <dc:creator>Ujjawal</dc:creator>
      <dc:date>2015-07-02T15:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194543#M36576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Provide some test data, in the form of a datastep, and some required output.&amp;nbsp; Personally I never recommend putting lists of values in macro variables due to limitations and the code needed to deal with these.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2015 15:50:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194543#M36576</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-07-02T15:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194544#M36577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My guess is that you aren't selecting any values into your macro variables. The PERCENT column in the output table is not in decimal form so, 45.55% is not .4555 but 45.55. You are selecting "if &amp;lt;= 0.01" which would be 1% if it were in decimal form but is actually .0001% in the values that show up in the PERCENT column. I doubt you have any values that small so nothing is read into your macro variables. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2015 15:53:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194544#M36577</guid>
      <dc:creator>Scott_C_Moore</dc:creator>
      <dc:date>2015-07-02T15:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194545#M36578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One change you will need to make is to add double quotes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;if DSTRCT_Code in(&amp;amp;charvarname.) then DSTRCT_Code_NEW = "&amp;amp;charvarname2.";&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;else DSTRCT_Code_NEW = DSTRCT_Code;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It wouldn't make sense to have a SAS statement that says&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then DISTRCT_CODE_NEW = A_B_C&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;when there is no such variable as A_B_C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are other issues that bear investigating.&amp;nbsp; Will INTO : remove both leading and trailing blanks from the values of DSTRCT_Code?&amp;nbsp; (Probably, I haven't checked.)&amp;nbsp; Does PERCENT go on a scale of 0 to 1, or a scale of 0 to 100?&amp;nbsp; (I think it's 0 to 100, but again I haven't checked.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2015 16:17:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194545#M36578</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-07-02T16:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194546#M36579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have tried putting double quotes "&amp;amp;charvarname2." but it is not working. &lt;/P&gt;&lt;P&gt;NOTE: Invalid numeric data, &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;DSTRCT_Code&lt;/SPAN&gt;='RS79W'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It seems this line - " if DSTRCT_Code in(&amp;amp;charvarname.) then DSTRCT_Code_NEW = &amp;amp;charvarname2.;"&amp;nbsp; is converting DSTRCT_Code variable into numeric.&lt;/P&gt;&lt;P&gt;PERCENT go on a scale of 0 to 100. I know it should be &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px; background-color: #ffffff;"&gt;PERCENT &amp;lt;= 5 in my code. I was testing the code and by mistake, i put the wrong code here.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample District Code Field -&lt;/P&gt;&lt;P&gt;DSTRCT_Code&lt;/P&gt;&lt;P&gt;RS797&lt;/P&gt;&lt;P&gt;RS798&lt;/P&gt;&lt;P&gt;RS79W&lt;/P&gt;&lt;P&gt;RS79C&lt;/P&gt;&lt;P&gt;RS797&lt;/P&gt;&lt;P&gt;RS797&lt;/P&gt;&lt;P&gt;RS797&lt;/P&gt;&lt;P&gt;RS798&lt;/P&gt;&lt;P&gt;RS798&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2015 18:22:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194546#M36579</guid>
      <dc:creator>Ujjawal</dc:creator>
      <dc:date>2015-07-02T18:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194547#M36580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What appears in the log for the two %put statements?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2015 18:44:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194547#M36580</guid>
      <dc:creator>Scott_C_Moore</dc:creator>
      <dc:date>2015-07-02T18:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194548#M36581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suspect the conversion is happening at a slightly different place.&amp;nbsp; Namely, you have continued on with the same interactive SAS session.&amp;nbsp; Earlier runs that omitted the double quotes defined DSTRCT_Code_NEW as numeric within DEF.&amp;nbsp; Later runs that use SET DEF are locked into having a numeric variable DSTRCT_Code_NEW.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try starting a new SAS session and see what happens.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2015 18:49:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194548#M36581</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-07-02T18:49:16Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194549#M36582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;%put &amp;amp;charvarname.; and &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;%put &amp;amp;charvarname2.; returns what i want.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;%put &amp;amp;charvarname.; returns 'RS79W', &lt;SPAN style="font-size: 13.3333330154419px;"&gt;'RS79C'. And &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;%put &amp;amp;charvarname2.; returns RS79W_&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;RS79C.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2015 18:51:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194549#M36582</guid>
      <dc:creator>Ujjawal</dc:creator>
      <dc:date>2015-07-02T18:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194550#M36583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ujjawal,&lt;/P&gt;&lt;P&gt;I think it's more of a quoting issue. You need the values for the in operator to be enclosed in quotes. You can get the quotes as part of the macro variable value by formatting them with the $quote. format. Since I made up the data values, I used 25 as the limit for your conditional processing, you can change that to whatever is appropriate for your data.&lt;/P&gt;&lt;P&gt;Here's my code and I hope it's what you want:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data def;&lt;BR /&gt; input DSTRCT_Code $ ;&lt;BR /&gt;cards;&lt;BR /&gt;A&lt;BR /&gt;B&lt;BR /&gt;D&lt;BR /&gt;A&lt;BR /&gt;B&lt;BR /&gt;D&lt;BR /&gt;C&lt;BR /&gt;C&lt;BR /&gt;A&lt;BR /&gt;A&lt;BR /&gt;A&lt;BR /&gt;B&lt;BR /&gt;B&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;proc freq data=def;&lt;/P&gt;&lt;P&gt;table DSTRCT_Code / out= abcd;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc print data=abcd;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;PROC SQL ; * NOPRINT;&amp;nbsp; ****I took out noprint just to make sure I was getting results;&lt;BR /&gt;select dstrct_code format=$quote10.&amp;nbsp; into :charvarname separated by ',' &lt;BR /&gt;from abcd&lt;/P&gt;&lt;P&gt;having PERCENT &amp;lt;= 25 and DSTRCT_Code is not null;&lt;BR /&gt;QUIT;&lt;BR /&gt;%put charvarname=&amp;amp;charvarname;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC SQL NOPRINT;&lt;/P&gt;&lt;P&gt;Select DSTRCT_Code INTO : charvarname2 separated by "_"&lt;/P&gt;&lt;P&gt;from abcd&lt;/P&gt;&lt;P&gt;having PERCENT &amp;lt;= 25 and DSTRCT_Code is not null;&lt;/P&gt;&lt;P&gt;QUIT;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2015 19:35:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194550#M36583</guid>
      <dc:creator>kaade</dc:creator>
      <dc:date>2015-07-02T19:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194551#M36584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; Also i need to make sure if the variable name exceeds 32 characters, &lt;/P&gt;&lt;P&gt;&amp;gt; it should truncate macro variable up to 32 characters&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let charvarname = %substr&lt;/P&gt;&lt;P&gt;(&amp;amp;charvarname&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; !,1,32);&lt;/P&gt;&lt;P&gt;%*12345678901234567890123456789012!;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will be obvious whatr is happening when you view this statement in monospace font&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2015 20:36:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194551#M36584</guid>
      <dc:creator>Ron_MacroMaven</dc:creator>
      <dc:date>2015-07-02T20:36:16Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194552#M36585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I was able to crack it. When i use KEEP option and select only the categorical variable, the code works fine. But when i run it on full dataset, it throws error. "&lt;SPAN style="line-height: 1.5em;"&gt;DSTRCT_Code_NEW " has been assigned both numeric and character. In this case, it treats DSTRCT_Code as a numeric variable so it makes &lt;STRONG style="color: #ff0000; font-family: inherit; font-size: 13px; font-style: inherit; background-color: #ffffff;"&gt;DSTRCT_Code_NEW &lt;/STRONG&gt;as numeric variable.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;The code below works fine with KEEP option.&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data def1;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;set def (KEEP = DSTRCT_Code) ;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #ff0000;"&gt;if DSTRCT_Code in(&amp;amp;charvarname.) then DSTRCT_Code_NEW = "&amp;amp;charvarname2.";&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit; color: #ff0000;"&gt;else DSTRCT_Code_NEW = DSTRCT_Code;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2015 19:14:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194552#M36585</guid>
      <dc:creator>Ujjawal</dc:creator>
      <dc:date>2015-07-03T19:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194553#M36586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This behavior is native to SAS system and its default type assignment being a SAS NUMERIC variable unless overridden (various techniques possible).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, encourage any self-initiated desk-checking with optimal diagnostic output for SAS log by using this OPTION setting:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OPTIONS SOURCE SOURCE2 MACROGEN SYMBOLGEN MLOGIC /* MPRINT */ ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scott Barry&lt;/P&gt;&lt;P&gt;SBBWorks, Inc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2015 19:59:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194553#M36586</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2015-07-03T19:59:15Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194554#M36587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have a good solution, but the problem was never with DSTRCT_Code.&amp;nbsp; It was always with DSTRCT_Code_NEW.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After you experimented with this a few times, your experiments had added a numeric variable DSTRCT_Code_NEW to the DEF data set.&amp;nbsp; Later, SET DEF brought in a numeric variable DSTRCT_Code_NEW.&amp;nbsp; Your programming statements were (naturally) unable to change the numeric variable into a character variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By adding KEEP=, you are no longer bringing in other variables.&amp;nbsp; So your programming statements are able to create a DSTRCT_Code_NEW as a character variable.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2015 20:14:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194554#M36587</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-07-03T20:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not resolving</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194555#M36588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a ton! This logic makes sense completely. Sure, i will check the same. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2015 20:31:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-variable-not-resolving/m-p/194555#M36588</guid>
      <dc:creator>Ujjawal</dc:creator>
      <dc:date>2015-07-03T20:31:29Z</dc:date>
    </item>
  </channel>
</rss>

