<?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: SAS stored process variables values changing in Developers</title>
    <link>https://communities.sas.com/t5/Developers/SAS-stored-process-variables-values-changing/m-p/576993#M5918</link>
    <description>&lt;P&gt;Thank you so much for the perfect input, it works as charm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the best,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lyudmil&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jul 2019 17:20:55 GMT</pubDate>
    <dc:creator>lyudmilpetrov</dc:creator>
    <dc:date>2019-07-26T17:20:55Z</dc:date>
    <item>
      <title>SAS stored process variables values changing</title>
      <link>https://communities.sas.com/t5/Developers/SAS-stored-process-variables-values-changing/m-p/576966#M5915</link>
      <description>&lt;P&gt;Dear experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a simple request to create variable in SAS Stored process and concatenate two strings one is coming from GLOBAL variable / prompt / input&lt;/P&gt;&lt;P&gt;and the other is static.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where &amp;amp;user is Global input.&lt;/P&gt;&lt;P&gt;If I run the stored process and enter into the prompt for user variable the info:&lt;/P&gt;&lt;P&gt;ABCD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;call symputx('end_table_1', &amp;amp;user || '_end_1');&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%put &amp;amp;user;&lt;BR /&gt;%put &amp;amp;end_table_1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will see as result printed out&lt;/P&gt;&lt;P&gt;36 +%put &amp;amp;USER;&lt;BR /&gt;ABCD&lt;BR /&gt;37 +%put &amp;amp;end_table_1;&lt;BR /&gt;._end_1&lt;/P&gt;&lt;P&gt;which the dot tells me that $user is not visible in (call symputx), but how come is visible for %put.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But if that run separately as program it executes fine:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let user = 'test';&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;call symputx('end_table_1', &amp;amp;user. || '_end_1');&lt;BR /&gt;run;%put &amp;amp;USER;&lt;BR /&gt;%put &amp;amp;end_table_1;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;33 %put &amp;amp;USER;&lt;BR /&gt;'test'&lt;BR /&gt;34 %put &amp;amp;end_table_1;&lt;BR /&gt;test_end_1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Much appreciated any help,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 16:15:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-stored-process-variables-values-changing/m-p/576966#M5915</guid>
      <dc:creator>lyudmilpetrov</dc:creator>
      <dc:date>2019-07-26T16:15:48Z</dc:date>
    </item>
    <item>
      <title>Re: SAS stored process variables values changing</title>
      <link>https://communities.sas.com/t5/Developers/SAS-stored-process-variables-values-changing/m-p/576980#M5916</link>
      <description>&lt;P&gt;The problem is related to this line of logic:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;call symputx('end_table_1', &amp;amp;user || '_end_1');&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When &amp;amp;user resolves the line becomes this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;call symputx('end_table_1', ABCD || '_end_1');&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So it thinks that there is a variable called ABCD and attempts to populate with a value from that&amp;nbsp;variable. So you end&amp;nbsp;up getting&amp;nbsp;that weird macro resolution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now when you ran the code&amp;nbsp;and used 'test' as the value of&amp;nbsp;&amp;amp;user, you included the quotes in the resolved value&amp;nbsp;of the macro.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So&amp;nbsp;that time the line would appear as this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;call symputx('end_table_1', 'test' || '_end_1');&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So SAS knew that test was a literal text string and concatenated with the other literal text string and your final macro resolved appropriately.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Simplest solution - Put double quotation marks around your &amp;amp;user macro in the Call Symputx statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
call symputx('end_table_1', "&amp;amp;user" || '_end_1');
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;That should solve your problem. the macro will resolve within the double quotes (not within single quotes), and the quotation marks will remain, letting SAS know that ABCD is a literal string and not a variable name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 16:44:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-stored-process-variables-values-changing/m-p/576980#M5916</guid>
      <dc:creator>tsap</dc:creator>
      <dc:date>2019-07-26T16:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: SAS stored process variables values changing</title>
      <link>https://communities.sas.com/t5/Developers/SAS-stored-process-variables-values-changing/m-p/576992#M5917</link>
      <description>Thanks a lot very clear explanation almost accepted without testing, but test and perfect.&lt;BR /&gt;&lt;BR /&gt;Much appreciated and all the best,&lt;BR /&gt;&lt;BR /&gt;Lyudmil</description>
      <pubDate>Fri, 26 Jul 2019 17:20:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-stored-process-variables-values-changing/m-p/576992#M5917</guid>
      <dc:creator>lyudmilpetrov</dc:creator>
      <dc:date>2019-07-26T17:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: SAS stored process variables values changing</title>
      <link>https://communities.sas.com/t5/Developers/SAS-stored-process-variables-values-changing/m-p/576993#M5918</link>
      <description>&lt;P&gt;Thank you so much for the perfect input, it works as charm.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the best,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lyudmil&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 17:20:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-stored-process-variables-values-changing/m-p/576993#M5918</guid>
      <dc:creator>lyudmilpetrov</dc:creator>
      <dc:date>2019-07-26T17:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: SAS stored process variables values changing</title>
      <link>https://communities.sas.com/t5/Developers/SAS-stored-process-variables-values-changing/m-p/577057#M5919</link>
      <description>Glad I could help!</description>
      <pubDate>Fri, 26 Jul 2019 19:31:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/SAS-stored-process-variables-values-changing/m-p/577057#M5919</guid>
      <dc:creator>tsap</dc:creator>
      <dc:date>2019-07-26T19:31:52Z</dc:date>
    </item>
  </channel>
</rss>

