10-06-2012 06:26 AM
Hello, i'm a beginner in SAS, and i have a problem with the function ROUND !
If I create toto table :
input Annee Note Bac $; /* JAMAIS d'accent */
97 12.025 A
98 13.075 A
97 9.045 B
98 8.250 A
97 7.685 C
98 10.554 C
97 14.895 B
then i want to print only Note var with rounding !
title "Exemple d'édition de certaines variables";
proc print data=toto noobs round;
var note bac;
it gives a 0.01 default rounding
but what if i want a 0.1 roundinf for example ?
i have so many syntax errors that i'm a bit upset now
10-06-2012 08:24 AM
You must associate a format to the variable, with the statement :
format note 6.1;
If you insert that statement in your datastep, the format will be permanently associated to the variable. If you put the format statement in the proc print call it will be associated only for the duration of the procedure.
10-06-2012 10:01 AM
in format 6.1, or more generally w.d, w is the width of the field and d is the number of decimals. Check
there are LOTS of formats available.
10-06-2012 10:42 AM
thanks for all
hu i have another question, but i guess i have to create another topic instead of asking here because this is about something else :smileygrin: