Dear Friends and experts.
Good evening.
I could not solve this problem.
Sometimes it read correctly but this time it produce data like above.
Reading real numbers has no problem.
Help me, please
Dear guys,
My coding likes below;
Infile 'AA.csv' delimiter = ',' MISSOVER DSD lrecl=32767 firstobs=2;
Informat B1 Best12.6; Format B1 Best12.6;
Informat B2 Best12.6; Format B2 Best12.6;
input B1 B2;
run;
post you code with your input data and you log.
Please provide a reproducible example. Are you reading data with an informat? Is this in the DATA step? Are you reading from a text file? An Excel spreadsheet? etc,
Use best12
If you're using something such as 8.3 it assumes you MUST always have 3 decimal points and reads it accordingly.
Most likely you have accidentally used an INFORMAT that includes .6 on the end. The meaning of the decimal part on a INFORMAT is different than the meaning of the decimal part on a FORMAT. When a decimal part is specified on a INFORMAT it tells SAS where to put an implied decimal point when the input text does not have one. Basically it tells SAS how many powers of ten to divide integers by.
Try this example.
data have ;
input @1 normal 32. @1 wrong 32.6 ;
format _numeric_ 32.6 ;
cards;
12
12.34
0.000012
;
proc print;
run;
Dear guys,
My coding likes below;
Infile 'AA.csv' delimiter = ',' MISSOVER DSD lrecl=32767 firstobs=2;
Informat B1 Best12.6; Format B1 Best12.6;
Informat B2 Best12.6; Format B2 Best12.6;
input B1 B2;
run;
Thank you for your kind help.
It workd after I changed the informat and format of variable from Best12.6 to Best 12.
But would you let me know what to be careful when I use those formats.
best,
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.