<?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: change variable from char (with $ signs and paranthesis) to num, then sum and add total to SQL in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/change-variable-from-char-with-signs-and-paranthesis-to-num-then/m-p/495777#M130928</link>
    <description>&lt;P&gt;advice on how to sum and insert the totals into the bottom of the table?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; mergembr &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; a.participantID, a.clientname, a.DOB, a.servicesite, a.dos, a.procedure, a.MBRlabel,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;a.paymentsource,a.rate,input(a.rate,&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;comma32.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; newrate, b.servicesite, b.sfs_provider_name, b.hri_and_or_SFS_address, b.sfs_address&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; work.stateNew_MBR_51 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; a&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;left&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;join&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; work.credfilesfs &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; b&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;on&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; input(a.servicesite,&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;best8.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;)=b.servicesite;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;insert&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;into&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; mergembr&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; sum(calculated newrate)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; work.stateNew_MBR_51;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Sep 2018 17:41:05 GMT</pubDate>
    <dc:creator>annie_doh</dc:creator>
    <dc:date>2018-09-14T17:41:05Z</dc:date>
    <item>
      <title>change variable from char (with $ signs and paranthesis) to num, then sum and add total to SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/change-variable-from-char-with-signs-and-paranthesis-to-num-then/m-p/495761#M130919</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a character variable named "Rate" that I am importing from excel that is $38. It represents a monetary value and appears has either $XXX.XX or ($XXX.XX) --The parenthesis represent negative amounts. I am trying to work with this variable in proc sql to convert it from character to numeric, then sum it up and add total to the table so I can then export it again in excel using ods tagsets and proc print. This is all occurring in a macro as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a snippet of my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; mergembr &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; a.participantID, a.servicesite, a.dos, a.procedure, a.MBRlabel,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;a.paymentsource, input(a.rate,&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;38&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;format&lt;/FONT&gt; &lt;FONT color="#008080" face="Courier New" size="2"&gt;comma12.2&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;, b.servicesite, b.sfs_provider_name, b.hri_and_or_SFS_address, b.sfs_address&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; work.stateNew_MBR_51 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; a&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;left&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;join&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; work.credfilesfs &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; b&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;on&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; input(a.servicesite,&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;best8.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;)=b.servicesite;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;insert&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;into&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; mergembr&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; sum(a.rate)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; work.stateNew_MBR_51;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 16:50:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/change-variable-from-char-with-signs-and-paranthesis-to-num-then/m-p/495761#M130919</guid>
      <dc:creator>annie_doh</dc:creator>
      <dc:date>2018-09-14T16:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: change variable from char (with $ signs and paranthesis) to num, then sum and add total to SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/change-variable-from-char-with-signs-and-paranthesis-to-num-then/m-p/495773#M130925</link>
      <description>&lt;P&gt;Wrong informat:&lt;/P&gt;
&lt;PRE&gt;data example;
   string= '($1,456,899,234.56)';
   num = input(string,comma32.);

run;&lt;/PRE&gt;
&lt;P&gt;Note that the limit on the comma format is 32. If there are actually 38 characters in a currency value you will need to do something. Without examples it is hard to tell what that something might actually be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 17:21:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/change-variable-from-char-with-signs-and-paranthesis-to-num-then/m-p/495773#M130925</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-09-14T17:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: change variable from char (with $ signs and paranthesis) to num, then sum and add total to SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/change-variable-from-char-with-signs-and-paranthesis-to-num-then/m-p/495775#M130926</link>
      <description>&lt;P&gt;I am having some luck with this but it is removing the parenthesis when I think I'll ultimately need them to be negatives so that it sums up correctly&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="example.PNG" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/23282i8128996DD0178F45/image-size/large?v=v2&amp;amp;px=999" role="button" title="example.PNG" alt="example.PNG" /&gt;&lt;/span&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; mergembrnew &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; servicesite, dos, rate, input(compress(rate,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'0123456789'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;,&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;'k'&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;),&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;dollar32.2&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; newrate &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; work.stateNew_MBR_51;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 17:28:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/change-variable-from-char-with-signs-and-paranthesis-to-num-then/m-p/495775#M130926</guid>
      <dc:creator>annie_doh</dc:creator>
      <dc:date>2018-09-14T17:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: change variable from char (with $ signs and paranthesis) to num, then sum and add total to SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/change-variable-from-char-with-signs-and-paranthesis-to-num-then/m-p/495776#M130927</link>
      <description>&lt;P&gt;ahhh yes...It is converting like I need it to! Now I am going to try to sum it and insert the sum as a total in the output&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 17:32:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/change-variable-from-char-with-signs-and-paranthesis-to-num-then/m-p/495776#M130927</guid>
      <dc:creator>annie_doh</dc:creator>
      <dc:date>2018-09-14T17:32:07Z</dc:date>
    </item>
    <item>
      <title>Re: change variable from char (with $ signs and paranthesis) to num, then sum and add total to SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/change-variable-from-char-with-signs-and-paranthesis-to-num-then/m-p/495777#M130928</link>
      <description>&lt;P&gt;advice on how to sum and insert the totals into the bottom of the table?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;create&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; mergembr &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; a.participantID, a.clientname, a.DOB, a.servicesite, a.dos, a.procedure, a.MBRlabel,&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;a.paymentsource,a.rate,input(a.rate,&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;comma32.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;) &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; newrate, b.servicesite, b.sfs_provider_name, b.hri_and_or_SFS_address, b.sfs_address&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; work.stateNew_MBR_51 &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; a&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;left&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;join&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; work.credfilesfs &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;as&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; b&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;on&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; input(a.servicesite,&lt;/FONT&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;best8.&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;)=b.servicesite;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;insert&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;into&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; mergembr&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; sum(calculated newrate)&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; work.stateNew_MBR_51;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 17:41:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/change-variable-from-char-with-signs-and-paranthesis-to-num-then/m-p/495777#M130928</guid>
      <dc:creator>annie_doh</dc:creator>
      <dc:date>2018-09-14T17:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: change variable from char (with $ signs and paranthesis) to num, then sum and add total to SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/change-variable-from-char-with-signs-and-paranthesis-to-num-then/m-p/495786#M130932</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Try&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;nlmny10.&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;or&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;rstdodn10.&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;format if you want to see parenthesis&amp;nbsp;for negative&amp;nbsp;currency values.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you want totals at the bottom of the table then PROC SQL might not be the right approach. You may need to try PROC REPORT or PROC TABULATE. Show provide some sample data in the form of a datastep please.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 18:03:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/change-variable-from-char-with-signs-and-paranthesis-to-num-then/m-p/495786#M130932</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-09-14T18:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: change variable from char (with $ signs and parenthesis) to num, then sum and add total to SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/change-variable-from-char-with-signs-and-paranthesis-to-num-then/m-p/495789#M130934</link>
      <description>Good Point. I am using proc print and ods tagsets excel to export the data. I need it to end up in excel spreadsheets. I can look into proc report and proc tabulate, I am somewhat familiar. Thanks!!&lt;BR /&gt;</description>
      <pubDate>Fri, 14 Sep 2018 18:14:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/change-variable-from-char-with-signs-and-paranthesis-to-num-then/m-p/495789#M130934</guid>
      <dc:creator>annie_doh</dc:creator>
      <dc:date>2018-09-14T18:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: change variable from char (with $ signs and parenthesis) to num, then sum and add total to SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/change-variable-from-char-with-signs-and-paranthesis-to-num-then/m-p/495790#M130935</link>
      <description>Hi:&lt;BR /&gt;  I'm not sure why you need SQL to do the final summary, PRINT, REPORT and TABULATE will all summarize negative and positive numbers correctly. PROC PRINT has the SUM statement; PROC REPORT has the BREAK and RBREAK statements and PROC TABULATE has the ALL keyword.&lt;BR /&gt;&lt;BR /&gt;Cynthia</description>
      <pubDate>Fri, 14 Sep 2018 18:19:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/change-variable-from-char-with-signs-and-paranthesis-to-num-then/m-p/495790#M130935</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-09-14T18:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: change variable from char (with $ signs and parenthesis) to num, then sum and add total to SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/change-variable-from-char-with-signs-and-paranthesis-to-num-then/m-p/495792#M130937</link>
      <description>&lt;P&gt;If your using SAS 9.4 M3 or later, then try ODS EXCEL instead of ODS EXCELXP.TAGSETS&amp;nbsp; to create native Excel files (xlsx). Only thing you need to worry about ODS EXCEL is insufficient memory issue when your trying to send large table into Excel. ODS Tagsets inserts one row at a time, where as ODS EXCEL will insert the whole table at once which cause insufficient memory issues.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Consider this &lt;A href="https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2018/2174-2018.pdf" target="_self"&gt;SAS Paper&lt;/A&gt; if you prefer ODS Excel&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 18:22:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/change-variable-from-char-with-signs-and-paranthesis-to-num-then/m-p/495792#M130937</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-09-14T18:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: change variable from char (with $ signs and parenthesis) to num, then sum and add total to SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/change-variable-from-char-with-signs-and-paranthesis-to-num-then/m-p/495795#M130940</link>
      <description>Here is my total program:&lt;BR /&gt;I'll need to sum the total of the rate column for each site within a contractor and they should each get their own tab in the excel. I'll look into the sum option in proc print.&lt;BR /&gt;%let conlist=51;*73 75 85 88 94 95 97;&lt;BR /&gt;options validvarname=any mprint mlogic symbolgen;&lt;BR /&gt;%macro conloop();&lt;BR /&gt;%do i=1 %to 1;*8;&lt;BR /&gt;%let contract=%scan(&amp;amp;conlist,&amp;amp;i);&lt;BR /&gt;&lt;BR /&gt;*merge PEID to federal/HRI output;&lt;BR /&gt;proc sort data=work.fedNew_MBR_&amp;amp;contract;&lt;BR /&gt;by ServiceSite name;&lt;BR /&gt;run;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table fedmerge&amp;amp;contract as&lt;BR /&gt;select a.participantID, a.clientname, a.DOB, a.servicesite, a.dos, a.procedure, a.MBRlabel,&lt;BR /&gt;a.paymentsource, a.rate,input(a.rate,comma32.) as newrate, sum(calculated newrate) as sumnewrate, b.servicesite, b.name, b.addressline1, b.addressline2, b.addressline3,&lt;BR /&gt;b.city, b.statecd, b.zip&lt;BR /&gt;from work.fedNew_MBR_&amp;amp;contract as a&lt;BR /&gt;left join work.credfilespeid as b&lt;BR /&gt;on input(a.servicesite,best8.)=input(b.servicesite,best8.) group by a.servicesite;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;*federal output;&lt;BR /&gt;ods listing close;&lt;BR /&gt;ods tagsets.excelxp file="J:\Data Requests\Internal Data Requests\Fiscal\July 2018 MBR\Federal\New_MBR_&amp;amp;contract._Federalmerg.xls"&lt;BR /&gt;style=printer options(orientation='landscape' embedded_titles='yes' embedded_footnotes='yes' ABSOLUTE_COLUMN_WIDTH='15'&lt;BR /&gt;SUPPRESS_BYLINES='yes' SHEET_LABEL='Sitecode=#BYVAL(ServiceSite) ');&lt;BR /&gt;title1 "New York State Department of Health Cancer Services Program";&lt;BR /&gt;title2 "Cancer Services Program";&lt;BR /&gt;title3 "Patient Services Summary";&lt;BR /&gt;title4 justify=LEFT '#BYVAL(name)';&lt;BR /&gt;footnote1 "Report Prepared: %sysfunc(today(),mmddyy10.)";&lt;BR /&gt;&lt;BR /&gt;proc print data=work.fedmerge&amp;amp;contract&lt;BR /&gt;uniform noobs style=[font_size=12];&lt;BR /&gt;by ServiceSite name;&lt;BR /&gt;var ParticipantID ServiceSite DOS Procedure MBRLabel PaymentSource Rate newrate sumnewrate&lt;BR /&gt;name addressline1 addressline2 addressline3 city statecd zip/style(header)={backgroundcolor=white};&lt;BR /&gt;pageby ServiceSite;&lt;BR /&gt;*where PaymentSource="Federal";&lt;BR /&gt;run;&lt;BR /&gt;ods tagsets.excelXP close;&lt;BR /&gt;ods listing;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;*merge PEID to federal crc output;&lt;BR /&gt;proc sort data=work.fedcrcNew_MBR_&amp;amp;contract;&lt;BR /&gt;by ServiceSite name;&lt;BR /&gt;run;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table fedcrcmerge&amp;amp;contract as&lt;BR /&gt;select a.participantID, a.clientname, a.DOB, a.servicesite, a.dos, a.procedure, a.MBRlabel,&lt;BR /&gt;a.paymentsource, a.rate,input(a.rate,comma32.) as newrate, sum(calculated newrate) as sumnewrate,b.servicesite, b.name, b.addressline1, b.addressline2, b.addressline3,&lt;BR /&gt;b.city, b.statecd, b.zip&lt;BR /&gt;from work.fedcrcNew_MBR_&amp;amp;contract as a&lt;BR /&gt;left join work.credfilespeid as b&lt;BR /&gt;on input(a.servicesite,best8.)=b.servicesite group by a.servicesite;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;*output for federal CRC;&lt;BR /&gt;ods listing close;&lt;BR /&gt;ods tagsets.excelxp file="J:\Data Requests\Internal Data Requests\Fiscal\July 2018 MBR\Federal CRC\New_MBR_&amp;amp;contract._FederalCRCmerg.xls"&lt;BR /&gt;style=printer options(orientation='landscape' embedded_titles='yes' embedded_footnotes='yes' ABSOLUTE_COLUMN_WIDTH='15'&lt;BR /&gt;SUPPRESS_BYLINES='yes' SHEET_LABEL='Sitecode=#BYVAL(ServiceSite) ');&lt;BR /&gt;title1 "New York State Department of Health Cancer Services Program";&lt;BR /&gt;title2 "Cancer Services Program";&lt;BR /&gt;title3 "Patient Services Summary";&lt;BR /&gt;title4 justify=LEFT '#BYVAL(name)';&lt;BR /&gt;footnote1 "Report Prepared: %sysfunc(today(),mmddyy10.)";&lt;BR /&gt;&lt;BR /&gt;proc print data=work.fedcrcmerge&amp;amp;contract&lt;BR /&gt;uniform noobs style=[font_size=12];&lt;BR /&gt;by ServiceSite name;&lt;BR /&gt;var ParticipantID ServiceSite DOS Procedure MBRLabel PaymentSource Rate newrate sumnewrate&lt;BR /&gt;name addressline1 addressline2 addressline3 city statecd zip/style(header)={backgroundcolor=white};&lt;BR /&gt;pageby ServiceSite;&lt;BR /&gt;*where PaymentSource="Federal CRC";&lt;BR /&gt;run;&lt;BR /&gt;ods tagsets.excelXP close;&lt;BR /&gt;ods listing;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;*merge state SFS to state MBR output;&lt;BR /&gt;proc sort data=work.stateNew_MBR_&amp;amp;contract;&lt;BR /&gt;by ServiceSite sfs_provider_name;&lt;BR /&gt;run;&lt;BR /&gt;proc sql;&lt;BR /&gt;create table statemerge&amp;amp;contract as&lt;BR /&gt;select a.participantID, a.servicesite, a.dos, a.procedure, a.MBRlabel,&lt;BR /&gt;a.paymentsource, a.rate,input(a.rate,comma32.) as newrate, sum(calculated newrate) as sumnewrate, b.servicesite,b.sfsvendorid, b.sfs_provider_name, b.hri_and_or_SFS_address, b.sfs_address&lt;BR /&gt;from work.stateNew_MBR_&amp;amp;contract as a&lt;BR /&gt;left join work.credfilesfs as b&lt;BR /&gt;on input(a.servicesite,best8.)=b.servicesite group by a.servicesite;&lt;BR /&gt;quit;&lt;BR /&gt;*output for state;&lt;BR /&gt;ods listing close;&lt;BR /&gt;ods tagsets.excelxp file="J:\Data Requests\Internal Data Requests\Fiscal\July 2018 MBR\State\New_MBR_&amp;amp;contract._Statemerg.xls"&lt;BR /&gt;style=printer options(orientation='landscape' embedded_titles='yes' embedded_footnotes='yes' ABSOLUTE_COLUMN_WIDTH='15'&lt;BR /&gt;SUPPRESS_BYLINES='yes' SHEET_LABEL='Sitecode=#BYVAL(ServiceSite) ' );&lt;BR /&gt;title1 "New York State Department of Health Cancer Services Program";&lt;BR /&gt;title2 "Cancer Services Program";&lt;BR /&gt;title3 "Patient Services Summary";&lt;BR /&gt;title4 justify=LEFT '#BYVAL(sfs_provider_name)';&lt;BR /&gt;footnote1 "Report Prepared: %sysfunc(today(),mmddyy10.)";&lt;BR /&gt;&lt;BR /&gt;proc print data=work.statemerge&amp;amp;contract&lt;BR /&gt;uniform noobs style=[font_size=12];&lt;BR /&gt;by ServiceSite sfs_provider_name;&lt;BR /&gt;var ParticipantID ServiceSite DOS Procedure MBRLabel PaymentSource Rate newrate sumnewrate&lt;BR /&gt;sfsvendorid sfs_provider_name hri_and_or_SFS_address sfs_address/style(header)={backgroundcolor=white};&lt;BR /&gt;pageby ServiceSite;&lt;BR /&gt;*where PaymentSource="State";&lt;BR /&gt;run;&lt;BR /&gt;ods tagsets.excelXP close;&lt;BR /&gt;ods listing;&lt;BR /&gt;&lt;BR /&gt;*Add state supplement output for months of April, May, June;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;%end;&lt;BR /&gt;%MEND;&lt;BR /&gt;%conloop;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 14 Sep 2018 18:26:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/change-variable-from-char-with-signs-and-paranthesis-to-num-then/m-p/495795#M130940</guid>
      <dc:creator>annie_doh</dc:creator>
      <dc:date>2018-09-14T18:26:31Z</dc:date>
    </item>
    <item>
      <title>Re: change variable from char (with $ signs and parenthesis) to num, then sum and add total to SQL</title>
      <link>https://communities.sas.com/t5/SAS-Programming/change-variable-from-char-with-signs-and-paranthesis-to-num-then/m-p/495800#M130942</link>
      <description>&lt;P&gt;great, the proc print sum is working perfectly thank you. Didn't realize I could use that! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 18:36:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/change-variable-from-char-with-signs-and-paranthesis-to-num-then/m-p/495800#M130942</guid>
      <dc:creator>annie_doh</dc:creator>
      <dc:date>2018-09-14T18:36:53Z</dc:date>
    </item>
  </channel>
</rss>

