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.
Please post your whole code, and the log from it. Use the proper sub-windows for this (see https://communities.sas.com/t5/help/faqpage/faq-category-id/posting#posting)
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.