I have the below example SAS code, which output ht2 using input with informat 3. My understanding of ht2 =INPUT(ht,3.) is that ht will be output if has 3 digits (including decimal). But instead in the below code all of ht2 are missing.
data left;
input name $ ht ;
datalines;
dick 20.55
sam 2.5
roger 2
peter 200
;
run;
data left2;
set left;
ht2= INPUT(ht,3.);
run;
SAS’ Output of left2
| name | ht | ht2 |
| ——– | ————– | ——– | ————– |
| dick | 20.55| . |
| sam | 2.5 | . |
| roger | 2 | . |
| peter | 200 | . |
Expected Output of left2
| name | ht | ht2 |
| ——– | ————– | ——– | ————– |
| dick | 20.55| . |
| sam | 2.5 | 2.5 |
| roger | 2 | 2 |
| peter | 200 | 200 |