Explanation : Data transformation in the 'MINUTES' table. Uses an ARRAY to reference the TIME0-TIME4 columns and a DO loop to divide each value by 60 and round it to the first decimal place.
Copied!
data MINUTES;
set EXPER;
array TIME[0:4] TIME0-TIME4;
do i = 0 to 4;
TIME[i]= round(TIME[i]/60,0.1);
end;
drop i;
1
DATA MINUTES;
2
SET EXPER;
3
array TIME[0:4] TIME0-TIME4;
4
DO i = 0 to 4;
5
TIME[i]= round(TIME[i]/60,0.1);
6
END;
7
drop i;
3 Code Block
PROC PRINT
Explanation : Printing of the transformed 'MINUTES' dataset to standard output.
Copied!
proc print data=MINUTES;
title'Problem 15.8 Listing of Time Measured in Minutes';
run;
1
2
PROC PRINT
3
DATA=MINUTES;
4
title'Problem 15.8 Listing of Time Measured in Minutes';
5
RUN;
6
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.