<?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: Using macro stored numbers in report- symput in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-macro-stored-numbers-in-report-symput/m-p/485891#M21439</link>
    <description>&lt;P&gt;Macro variable contains STRING/TEXT. It will&amp;nbsp;store whatever you feed to it. if want '10,000', then you need to feed that into&amp;nbsp;it.&amp;nbsp;So while dealing numeric, you can't directly feed its format to macro variable, instead, you may need to convert it first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  input num;
  call symputx('val',put(num,comma8.));
datalines;
10000
;
run;

%put val=&amp;amp;val;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Aug 2018 17:47:44 GMT</pubDate>
    <dc:creator>Haikuo</dc:creator>
    <dc:date>2018-08-10T17:47:44Z</dc:date>
    <item>
      <title>Using macro stored numbers in report- symput</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-macro-stored-numbers-in-report-symput/m-p/485885#M21437</link>
      <description>&lt;P&gt;I am having difficulty saving a number format in a report. I have reviewed the comments on&amp;nbsp;&lt;A href="https://communities.sas.com/t5/Base-SAS-Programming/CALL-SYMPUT-vs-CALL-SYMPUTX/td-p/377866" target="_blank"&gt;https://communities.sas.com/t5/Base-SAS-Programming/CALL-SYMPUT-vs-CALL-SYMPUTX/td-p/377866&lt;/A&gt; but I can't get the&amp;nbsp;comma8.2 format to work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Objective- Keep the comma, as in - 10,000, when I call the macro for saved numeric value to add to a report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;set data;&lt;BR /&gt;call symputx("val",Total,comma8.2);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-tried it also with&amp;nbsp;vvaluex(Total,comma8.2), and didn't work.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 17:33:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-macro-stored-numbers-in-report-symput/m-p/485885#M21437</guid>
      <dc:creator>HabAM</dc:creator>
      <dc:date>2018-08-10T17:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using macro stored numbers in report- symput</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-macro-stored-numbers-in-report-symput/m-p/485889#M21438</link>
      <description>&lt;P&gt;Doesn't work is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat&lt;/A&gt;... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also the approach you are using will only have the single value for the last record's value of the total variable&amp;nbsp;in the set data.&lt;/P&gt;
&lt;P&gt;And since this line&lt;/P&gt;
&lt;P&gt;call symputx("val",Total,comma8.2); generates errors&lt;/P&gt;
&lt;P&gt;perhaps you want&lt;/P&gt;
&lt;P&gt;call symputx("val", Put(Total,comma8.2));&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 17:42:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-macro-stored-numbers-in-report-symput/m-p/485889#M21438</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-08-10T17:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using macro stored numbers in report- symput</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-macro-stored-numbers-in-report-symput/m-p/485891#M21439</link>
      <description>&lt;P&gt;Macro variable contains STRING/TEXT. It will&amp;nbsp;store whatever you feed to it. if want '10,000', then you need to feed that into&amp;nbsp;it.&amp;nbsp;So while dealing numeric, you can't directly feed its format to macro variable, instead, you may need to convert it first.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  input num;
  call symputx('val',put(num,comma8.));
datalines;
10000
;
run;

%put val=&amp;amp;val;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 17:47:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-macro-stored-numbers-in-report-symput/m-p/485891#M21439</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2018-08-10T17:47:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using macro stored numbers in report- symput</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-macro-stored-numbers-in-report-symput/m-p/485893#M21440</link>
      <description>&lt;P&gt;READ.THE.LOG.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS does not provide the log out of pure boredom, it's there for a purpose: that you shall look at it and find what's wrong with your code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And read the&amp;nbsp;&lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.3&amp;amp;docsetId=lefunctionsref&amp;amp;docsetTarget=n1nexcs36ctqk5n11uao7k9myz7y.htm&amp;amp;locale=de" target="_blank"&gt;documentation of call symputx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Symputx expects a 'g' or 'l' as the third parameter, not a format.&lt;/P&gt;
&lt;P&gt;Do&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;call symputx("val",put(Total,comma8.2),'g');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;instead.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 17:51:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-macro-stored-numbers-in-report-symput/m-p/485893#M21440</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-08-10T17:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using macro stored numbers in report- symput</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-macro-stored-numbers-in-report-symput/m-p/486081#M21450</link>
      <description>&lt;P&gt;Thank you Kurt.&lt;/P&gt;&lt;P&gt;I know we all like to see the log. I don't see an error on the log....here is a log for the run with your suggestion&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;512 data _null_;&lt;BR /&gt;513 set data1;&lt;BR /&gt;514 call symputx('val',put(Total,comma8.2),'g');&lt;BR /&gt;515 run;&lt;/P&gt;&lt;P&gt;NOTE: There were 1 observations read from the data set WORK.data1.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;/P&gt;&lt;P&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's just not keeping the numeric format with comma separated values.&lt;/P&gt;&lt;P&gt;instead of 10,000 it is displaying 10000.00 Not sure if am explaining the problem proper.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its true,&amp;nbsp;&lt;SPAN&gt;SAS does not provide the log out of pure boredom...my problem is with the output.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 11 Aug 2018 20:08:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-macro-stored-numbers-in-report-symput/m-p/486081#M21450</guid>
      <dc:creator>HabAM</dc:creator>
      <dc:date>2018-08-11T20:08:34Z</dc:date>
    </item>
    <item>
      <title>Re: Using macro stored numbers in report- symput</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-macro-stored-numbers-in-report-symput/m-p/486082#M21451</link>
      <description>&lt;P&gt;This is not a macro problem.&amp;nbsp; Your number is large for the width of your format, so SAS took out the comma so it would fit.&lt;/P&gt;
&lt;P&gt;10000 is 5 digits&lt;/P&gt;
&lt;P&gt;. is 1 digit&lt;/P&gt;
&lt;P&gt;00 is 2 digits&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just increase the width of your format.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;call symputx('val',put(Total,comma32.2-L),'g');&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 11 Aug 2018 20:12:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-macro-stored-numbers-in-report-symput/m-p/486082#M21451</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-08-11T20:12:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using macro stored numbers in report- symput</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-macro-stored-numbers-in-report-symput/m-p/488424#M21484</link>
      <description>&lt;P&gt;READ.THE.DOC.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What on earth made you think that&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp; call symputx("val",Total,comma8.2);&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;was valid syntax?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The documentation shows that the third parameter&amp;nbsp;cannot possibly accept formats.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN class="xis-keyword"&gt;CALL SYMPUTX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN class="xis-userSuppliedSyntaxValue"&gt;&lt;A class="ng-scope" tabindex="0" title="Description of syntax: macro-variable" href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=n1nexcs36ctqk5n11uao7k9myz7y.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#n08fx8tps5rvxrn0z33yw3gy7eyp" data-docset-id="lefunctionsref" data-docset-version="9.4" data-original-href="n1nexcs36ctqk5n11uao7k9myz7y.htm#n08fx8tps5rvxrn0z33yw3gy7eyp"&gt;macro-variable&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="xis-userSuppliedSyntaxValue"&gt;&lt;A class="ng-scope" tabindex="0" title="Description of syntax: value" href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=n1nexcs36ctqk5n11uao7k9myz7y.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#p1gheufaqxn7dkn1qhqlcts1jd3u" data-docset-id="lefunctionsref" data-docset-version="9.4" data-original-href="n1nexcs36ctqk5n11uao7k9myz7y.htm#p1gheufaqxn7dkn1qhqlcts1jd3u"&gt;value&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="xis-argOptional"&gt;&amp;lt;,&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="xis-userSuppliedSyntaxValue"&gt;&lt;A class="ng-scope" tabindex="0" title="Description of syntax: symbol-table" href="https://documentation.sas.com/?docsetId=lefunctionsref&amp;amp;docsetTarget=n1nexcs36ctqk5n11uao7k9myz7y.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#p1kcuy9w7uvwaxn1fec64rgj0m7z" data-docset-id="lefunctionsref" data-docset-version="9.4" data-original-href="n1nexcs36ctqk5n11uao7k9myz7y.htm#p1kcuy9w7uvwaxn1fec64rgj0m7z"&gt;symbol-table&lt;/A&gt;&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The link you point to shows how to format values with function put().&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 05:00:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Using-macro-stored-numbers-in-report-symput/m-p/488424#M21484</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-08-21T05:00:03Z</dc:date>
    </item>
  </channel>
</rss>

