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,
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;
Run a PROC CONTENTS to see which variable(s) have the incriminated format, which you can then correct with PROC DATASETS.
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;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.