You could try it and find out yourself. Maxim 4
Do as @PaigeMiller said, but also test those 2 examples:
data test1;
input x 17.2;
cards;
17.1
17.22
17.333
17.4444
17.55555
;
run;
proc print;
run;
data test2;
input x 17.2;
cards;
171
1722
17333
174444
1755555
;
run;
proc print;
run;
and also see the doc:
w.d Informat :: SAS(R) 9.4 Formats and Informats: Reference
Bart
@HeatherNewton wrote:
If i special format as 17.2 on input statement, can sas read in a different format say 17.4?
I know if i dont specify it reads in any number
You cannot use any FORMAT with an INPUT statement. You can only use an INFORMAT.
Normally you never want to include a decimal place value on an informat because that means that SAS will insert an implied decimal point when the string does not have one.
The difference between 17.2 and 17.4 is where SAS will place the decimal point when the string does no contain one.
With 2 implied decimal places a string like '123456' will become the number 1234.56 but with 4 implied decimal places it will become 12.3456 instead.
So the proper informat to use when the values are 17 bytes long and did not have the decimal point purposely removed would be 17. with no number after the period.
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.