BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
commitsudoku
Obsidian | Level 7

Hi. I have a CSV file with 5600 rows and 331 columns. I successfully import the data using PROC IMPORT into RESULTS.

Once imported I can visualize the data in SAS and even use PROC FREQ and PROC TABULATE on RESULTS. 

But I need to recode some variables and for that I need to use PROC DATA.

So a very simple command just to put my imported data into a DATA PROC.

DATA data;
	SET RESULTS;
RUN;

But this gives the following error: 

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

Why is that? 

Thank you,

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Run PROC CONTENTS on the dataset.

Find the offending format.

proc contents data=results out=contents noprint;
run;

data _null_;
  set contents;
  where formatd >= formatl >0 ;
  put (libname memname name format formatd formatl) (=);
run;

Fix it. 

 

For example why not just remove any formats that PROC IMPORT decided to attach?  You normally do not need formats attached to numeric variables (unless they are date, time or datetime values).

DATA data;
   SET RESULTS;
   format _all_;
RUN;

View solution in original post

3 REPLIES 3
Tom
Super User Tom
Super User

Run PROC CONTENTS on the dataset.

Find the offending format.

proc contents data=results out=contents noprint;
run;

data _null_;
  set contents;
  where formatd >= formatl >0 ;
  put (libname memname name format formatd formatl) (=);
run;

Fix it. 

 

For example why not just remove any formats that PROC IMPORT decided to attach?  You normally do not need formats attached to numeric variables (unless they are date, time or datetime values).

DATA data;
   SET RESULTS;
   format _all_;
RUN;
commitsudoku
Obsidian | Level 7
Thank you so much! It worked perfectly!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 3 replies
  • 4999 views
  • 2 likes
  • 3 in conversation