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



data study; input Subj : $3. Group : $1. Dose : $4. Weight : ..

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

data study; input Subj : $3. Group : $1. Dose : $4. Weight : ..

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

Post New Answer

More SAS Interview Questions

what other SAS features do you use for error trapping and data validation?

3 Answers   Quintiles,


Can anyone help me about SAS Realtime scenarios in Clinical field

0 Answers  


diff between nodup rec and ondup key???

3 Answers   AON, Sciformix,


What is a pdv and what are its functions?

0 Answers  


how to get second highest salary from a employee table and how get a 5th highest salary from a employee table?

11 Answers   ABC, Amex,






What is the difference Using & and && in the macro variables

5 Answers   Accenture,


What are the limitations for memory allocation for SAS variables

0 Answers   Signetsoft,


what kind of variables are collected in AE dataset?

3 Answers   Accenture, Quintiles, SAS,


Dear all, proc means data=dsn noprint completetypes; class trtmntgroup /preloadfmt; output out=tot n=n; format trtmntgroup trtf. ; by vstgrp descending severity; run; This is the code I used for AE table. I got the values without giving the variable ‘trtmntgroup(numeric)’ in var statement. And if I give the var statement for that variable i’m getting the same values.How is that possible? What is the difference between class and var statement? Could any one explain me how does proc means work at the back end. And what is the difference between _freq_ value and N value in proc means. Thanks and regards, Rajesh.

1 Answers  


Can you execute macro within another macro? : sas-macro

0 Answers  


How to get second top scorer student from a class- table having different sections A, B, C & D? each section has same number of student.

4 Answers   TCS,


what is a method for assigning first.var and last.var to the by groupvariable on unsorted data? : Sas programming

0 Answers  


Categories