data study;
input Subj : $3.
Group : $1.
Dose : $4.
Weight : $8.
Subgroup;
x= input(Weight,5.1);
datalines;
001 A Low 220 2
002 A High 90 1
003 B Low 193.6 1
004 B High 165 2
005 A Low 123.4 1
;
Why does X get truncated? X shows up as 22 instead of 220,9
instead of 90 and 19.8 instead of 198? This problem doesnt
happen with the values 193.6 and 123.4.
This does not happen if x is read on the 5. informat instead
of the 5.1 informat
Answers were Sorted based on User's Feedback
Answer / kumaraswamy maduri
Informat 5.1 or 5.2 tell the SAS processor to allocate
specified number of decimals from right to left of the
value and the remaining to the number.
Informat 5. is good if you have one decimal even this fails
when you have more than one decimal.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / kumaraswamy maduri
Informat 5.1 or 5.2 tell the SAS processor to allocate
specified number of decimals from right to left of the
value and the remaining to the number.
Informat 5. is good if you have one decimal even this fails
when you have more than one decimal.
| Is This Answer Correct ? | 2 Yes | 0 No |
How can you limit the variables written to output dataset in data step?
How will you generate test data with no input data?
What is the difference between %local and %global? : sas-macro
How to get part of string form the source string without using sub string function in SAS?
Can you execute macro within another macro? If so, how would sas know where the current macro ended and the new one began? : sas-macro
What’s the difference between var b1 – b3 and var b1 — b3?
What is the registered Key word is sas????
Can Some one Explain How the Datasets from SAS can be loaded in to the MVS OS?
what is Global Symbol table and Local symbol table?
How the date 04oct1994 is stored in SAS,not only give the answer explain in brief?
what are informats in sas? : Sas-administrator
what is the difference between: x=a+b+c+d; and x=sum (of a, b, c ,d);? : Sas programming