BookmarkSubscribeRSS Feed
sam5
Calcite | Level 5

Hi,

 

I'm trying to export a table from SAS onto excel using a proc dataset which I have done countless times in the past.

However, I'm getting an error that I have not seen before and I'm not sure how to get past it.

 

This is my code:

 

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;
libname key excel "location";

Proc Datasets
lib=key;
Delete my_data;
Run;
Data key.my_data; 
set my_data;
Run;

libname key clear;

 

This is the error that appears:

 

ERROR: The decimal specification of 5 must be less than the width specification of 5.

 

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.

The table runs without any errors, it is only the proc datasets where the error occurs. 

I export other tables within this code and they run fine.

 

Any help would be appreciated.

 

 

1 REPLY 1

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1828 views
  • 0 likes
  • 2 in conversation