<?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: PERCENT format in SQL table query in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PERCENT-format-in-SQL-table-query/m-p/401479#M97411</link>
    <description>&lt;P&gt;Ok. Please post the full details of your issue, demo code and log that shows what's not working is a good start.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/21164"&gt;@greg6363&lt;/a&gt; wrote:&lt;BR /&gt;That's what I used and I get the following error:&lt;BR /&gt;&lt;BR /&gt;CLI describe error: [Microsoft][SQL Server Native Client 11.0][SQL Server] Incorrect syntax near 'format'. : [Microsoft][SQL Server Native Client 11.0][SQL Server] Statement(s) could not be prepared.&lt;BR /&gt;&lt;BR /&gt;I'm not querying on a SAS server. I am querying tables on a SQL server so the SAS language will not work.&lt;BR /&gt;&lt;BR /&gt;What SQL code can be used in SAS to properly format a field that calculates a percentsges?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Oct 2017 18:51:29 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-10-05T18:51:29Z</dc:date>
    <item>
      <title>PERCENT format in SQL table query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PERCENT-format-in-SQL-table-query/m-p/401470#M97407</link>
      <description>I have a PROC sql query that is hitting several SQL tables on a SQL server platform. I am trying to format a calculated field as a percentage but when I use the format percent 8.2 function after the declared variable, I get an error message. What SQL code do I need to format the field for this variable?&lt;BR /&gt;&lt;BR /&gt;Any assistance would be greatly appreciated. Thanks.</description>
      <pubDate>Thu, 05 Oct 2017 18:06:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PERCENT-format-in-SQL-table-query/m-p/401470#M97407</guid>
      <dc:creator>greg6363</dc:creator>
      <dc:date>2017-10-05T18:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: PERCENT format in SQL table query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PERCENT-format-in-SQL-table-query/m-p/401476#M97408</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;&amp;lt;calculation as percentage&amp;gt; as my_percent_variable format=percent8.2,&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 05 Oct 2017 18:38:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PERCENT-format-in-SQL-table-query/m-p/401476#M97408</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-05T18:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: PERCENT format in SQL table query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PERCENT-format-in-SQL-table-query/m-p/401478#M97410</link>
      <description>That's what I used and I get the following error:&lt;BR /&gt;&lt;BR /&gt;CLI describe error: [Microsoft][SQL Server Native Client 11.0][SQL Server] Incorrect syntax near 'format'.  : [Microsoft][SQL Server Native Client 11.0][SQL Server] Statement(s) could not be prepared.&lt;BR /&gt;&lt;BR /&gt;I'm not querying on a SAS server. I am querying tables on a SQL server so the SAS language will not work.&lt;BR /&gt;&lt;BR /&gt;What SQL code can be used in SAS to properly format a field that calculates a percentsges?&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Thu, 05 Oct 2017 18:49:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PERCENT-format-in-SQL-table-query/m-p/401478#M97410</guid>
      <dc:creator>greg6363</dc:creator>
      <dc:date>2017-10-05T18:49:32Z</dc:date>
    </item>
    <item>
      <title>Re: PERCENT format in SQL table query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PERCENT-format-in-SQL-table-query/m-p/401479#M97411</link>
      <description>&lt;P&gt;Ok. Please post the full details of your issue, demo code and log that shows what's not working is a good start.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/21164"&gt;@greg6363&lt;/a&gt; wrote:&lt;BR /&gt;That's what I used and I get the following error:&lt;BR /&gt;&lt;BR /&gt;CLI describe error: [Microsoft][SQL Server Native Client 11.0][SQL Server] Incorrect syntax near 'format'. : [Microsoft][SQL Server Native Client 11.0][SQL Server] Statement(s) could not be prepared.&lt;BR /&gt;&lt;BR /&gt;I'm not querying on a SAS server. I am querying tables on a SQL server so the SAS language will not work.&lt;BR /&gt;&lt;BR /&gt;What SQL code can be used in SAS to properly format a field that calculates a percentsges?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 18:51:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PERCENT-format-in-SQL-table-query/m-p/401479#M97411</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-05T18:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: PERCENT format in SQL table query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PERCENT-format-in-SQL-table-query/m-p/401487#M97415</link>
      <description>I put the log details of the error in the last message. &lt;BR /&gt;&lt;BR /&gt;Here's the code:&lt;BR /&gt;&lt;BR /&gt;sum(cash)/sum(originatingamt) as col_rate format=percent8.2&lt;BR /&gt;&lt;BR /&gt;When I run it, I get the error message that I detailed in the previous post. &lt;BR /&gt;&lt;BR /&gt;As I said, I am querying a SQL table, not a SAS table.</description>
      <pubDate>Thu, 05 Oct 2017 19:17:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PERCENT-format-in-SQL-table-query/m-p/401487#M97415</guid>
      <dc:creator>greg6363</dc:creator>
      <dc:date>2017-10-05T19:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: PERCENT format in SQL table query</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PERCENT-format-in-SQL-table-query/m-p/401488#M97416</link>
      <description>&lt;P&gt;If you're using pass through SQL then it needs to be in a format that the server understands. Since you're using MS SQL (T-SQL) see what Microsoft requires. Or format it after you bring it into SAS using PROC DATASETS.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2017 19:21:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PERCENT-format-in-SQL-table-query/m-p/401488#M97416</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-05T19:21:56Z</dc:date>
    </item>
  </channel>
</rss>

