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!

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 3 replies
  • 3655 views
  • 2 likes
  • 3 in conversation