<?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 Proc DataSet error: Decimal specification. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-DataSet-error-Decimal-specification/m-p/522172#M141722</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to export a table from SAS onto excel using a proc dataset which I have done countless times in the past.&lt;/P&gt;&lt;P&gt;However, I'm getting an error that I have not seen before and I'm not sure how to get past it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc Sql;
	create table my_data as
	select Month,
		   character_variable,
		   character_variable,
		   SUM(numeric_variable)/count(*) 
	from source
	group by 1,2,3;
run;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname key excel "location";

Proc Datasets
lib=key;
Delete &lt;SPAN&gt;my_data&lt;/SPAN&gt;;
Run;
Data key.&lt;SPAN&gt;my_data&lt;/SPAN&gt;; 
set &lt;SPAN&gt;my_data&lt;/SPAN&gt;;
Run;

libname key clear;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the error that appears:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ERROR: The decimal specification of 5 must be less than the width specification of 5.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried changing the numeric format from having no format to a 5.2 format to a 10.2 format but the same error appears every time.&lt;/P&gt;&lt;P&gt;The table runs without any errors, it is only the proc datasets where the error occurs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I export other tables within this code and they run fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Dec 2018 11:34:19 GMT</pubDate>
    <dc:creator>sam5</dc:creator>
    <dc:date>2018-12-20T11:34:19Z</dc:date>
    <item>
      <title>Proc DataSet error: Decimal specification.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-DataSet-error-Decimal-specification/m-p/522172#M141722</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to export a table from SAS onto excel using a proc dataset which I have done countless times in the past.&lt;/P&gt;&lt;P&gt;However, I'm getting an error that I have not seen before and I'm not sure how to get past it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc Sql;
	create table my_data as
	select Month,
		   character_variable,
		   character_variable,
		   SUM(numeric_variable)/count(*) 
	from source
	group by 1,2,3;
run;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname key excel "location";

Proc Datasets
lib=key;
Delete &lt;SPAN&gt;my_data&lt;/SPAN&gt;;
Run;
Data key.&lt;SPAN&gt;my_data&lt;/SPAN&gt;; 
set &lt;SPAN&gt;my_data&lt;/SPAN&gt;;
Run;

libname key clear;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the error that appears:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ERROR: The decimal specification of 5 must be less than the width specification of 5.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried changing the numeric format from having no format to a 5.2 format to a 10.2 format but the same error appears every time.&lt;/P&gt;&lt;P&gt;The table runs without any errors, it is only the proc datasets where the error occurs.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I export other tables within this code and they run fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Dec 2018 11:34:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-DataSet-error-Decimal-specification/m-p/522172#M141722</guid>
      <dc:creator>sam5</dc:creator>
      <dc:date>2018-12-20T11:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: Proc DataSet error: Decimal specification.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-DataSet-error-Decimal-specification/m-p/522174#M141723</link>
      <description>&lt;P&gt;Please post your whole code, and the log from it. Use the proper sub-windows for this (see &lt;A href="https://communities.sas.com/t5/help/faqpage/faq-category-id/posting#posting" target="_blank"&gt;https://communities.sas.com/t5/help/faqpage/faq-category-id/posting#posting&lt;/A&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 12:20:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-DataSet-error-Decimal-specification/m-p/522174#M141723</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-12-18T12:20:49Z</dc:date>
    </item>
  </channel>
</rss>

