<?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 tom unquote macro variable for usage in the resolve function in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-tom-unquote-macro-variable-for-usage-in-the-resolve-function/m-p/858717#M339287</link>
    <description>&lt;P&gt;I'm not sure what you are trying to do, but if &amp;amp;_fmm48 has the value shown, you could simply do this in a DATA step (after removing the quotes from around the macro variable value, they don't belong there)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;pred_cdf=&amp;amp;_fmm48;&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;</description>
    <pubDate>Tue, 14 Feb 2023 13:26:01 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2023-02-14T13:26:01Z</dc:date>
    <item>
      <title>How tom unquote macro variable for usage in the resolve function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-tom-unquote-macro-variable-for-usage-in-the-resolve-function/m-p/858714#M339285</link>
      <description>&lt;P&gt;I have this macro variable:&lt;/P&gt;
&lt;PRE&gt;82   %put &amp;amp;_fmm48.;
"0.1283200146 * cdf('normal', temp(1), 46.076814239 , 1.4242197152 ) + 0.4126163318 * cdf('normal', temp(1), 37.291694824 , 
4.5092171615 ) + 0.4590636536 * cdf('normal', temp(1), 22.406224725 , 7.4331299613 ) "
83   
84   %studio_hide_wrapper;&lt;/PRE&gt;
&lt;P&gt;And I want to use it in a resolve statement:&lt;/P&gt;
&lt;P&gt;I post the line that works and the failing resolve intent with the error message:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;if out_apzmto=48 then pred_cdf= 
0.1283200146 * cdf('normal', temp(1), 46.076814239 , 1.4242197152 ) 
+ 0.4126163318 * cdf('normal', temp(1), 37.291694824 , 4.5092171615 ) 
+ 0.4590636536 * cdf('normal', temp(1), 22.406224725 , 7.4331299613 );

pred_cdf=resolve(&amp;amp;_fmm48.);

NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column).
      96:10   98:33   
NOTE: Invalid numeric data, '.375327347 * cdf('normal', temp(1), 15.635497438 , 3.9918793772 ) + 0.3922306778 * cdf('normal', 
      temp(1), 26.175544333 , 3.1090404865 ) + 0.1005071903 * cdf('normal', temp(1), 31.998863512 , 0.8964434876 ) + 0.0450229677 * 
      cdf('normal', temp(1), 34 , 0.0001 ) + 0.0869118173 * cdf('normal', temp(1), 35.436121806 , 0.4959496162' , at line 96 column 
      10.&lt;/PRE&gt;</description>
      <pubDate>Tue, 14 Feb 2023 13:15:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-tom-unquote-macro-variable-for-usage-in-the-resolve-function/m-p/858714#M339285</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2023-02-14T13:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: How tom unquote macro variable for usage in the resolve function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-tom-unquote-macro-variable-for-usage-in-the-resolve-function/m-p/858716#M339286</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS calls removal of quotation marks &lt;EM&gt;dequoting&lt;/EM&gt;.&amp;nbsp; &lt;EM&gt;Unquoting&lt;/EM&gt; has a different meaning in SAS.&amp;nbsp; There is a DEQUOTE function, which can be called in the macro language via %SYSFUNC.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;pred_cdf=%sysfunc(dequote(&amp;amp;_fmm48.)) ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You shouldn't need the RESOLVE function for this example.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Often it is better to avoid adding quotation marks when you assign the value to your macro variable.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 13:25:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-tom-unquote-macro-variable-for-usage-in-the-resolve-function/m-p/858716#M339286</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-02-14T13:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: How tom unquote macro variable for usage in the resolve function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-tom-unquote-macro-variable-for-usage-in-the-resolve-function/m-p/858717#M339287</link>
      <description>&lt;P&gt;I'm not sure what you are trying to do, but if &amp;amp;_fmm48 has the value shown, you could simply do this in a DATA step (after removing the quotes from around the macro variable value, they don't belong there)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;pred_cdf=&amp;amp;_fmm48;&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;</description>
      <pubDate>Tue, 14 Feb 2023 13:26:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-tom-unquote-macro-variable-for-usage-in-the-resolve-function/m-p/858717#M339287</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-02-14T13:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: How tom unquote macro variable for usage in the resolve function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-tom-unquote-macro-variable-for-usage-in-the-resolve-function/m-p/858719#M339288</link>
      <description>&lt;P&gt;So easy...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a general rule when a macro variable shoud go within quotes?&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 13:31:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-tom-unquote-macro-variable-for-usage-in-the-resolve-function/m-p/858719#M339288</guid>
      <dc:creator>acordes</dc:creator>
      <dc:date>2023-02-14T13:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: How tom unquote macro variable for usage in the resolve function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-tom-unquote-macro-variable-for-usage-in-the-resolve-function/m-p/858722#M339289</link>
      <description>&lt;P&gt;I would say that you need quotes around macro variable values only in rare situations. I realize that isn't very helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The answer certainly depends on how you will be using the macro variable after it is assigned the value. For simple text replacement in a DATA step, which is what you are doing here, quotes are just not needed. Please remember that macro variables are used for text replacement, so the macro variable as it appears in your code is replaced by the text of the macro variable value, and once this replacement happens, the resulting code must be legal valid SAS code that does what you want. If you have quotes around your macro variable value, then&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;pred_cdf=&amp;amp;_fmm48;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is actually&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;pred_cdf = "0.1283200146 * cdf('normal', temp(1), 46.076814239 , 1.4242197152 ) + 0.4126163318 * cdf('normal', temp(1), 37.291694824 , 
4.5092171615 ) + 0.4590636536 * cdf('normal', temp(1), 22.406224725 , 7.4331299613 ) ";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and this assigns a text string to pred_cdf, that's what the quotes indicate, that this is a text string, and so no math happens.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 14:42:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-tom-unquote-macro-variable-for-usage-in-the-resolve-function/m-p/858722#M339289</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-02-14T14:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: How tom unquote macro variable for usage in the resolve function</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-tom-unquote-macro-variable-for-usage-in-the-resolve-function/m-p/858730#M339291</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/127222"&gt;@acordes&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;So easy...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a general rule when a macro variable shoud go within quotes?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's an easy one. When you want the value of the macro variable to contain the quotes.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 14:13:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-tom-unquote-macro-variable-for-usage-in-the-resolve-function/m-p/858730#M339291</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-02-14T14:13:23Z</dc:date>
    </item>
  </channel>
</rss>

