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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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