1. Consider the following small data set:
Kane 20 12 2005 12 25 Ambler 22 12 2005 8 20 Kane 20 01 2006 13 32 Oakey 32 12 2005 30 50 Oakey 32 01 2006 25 45 Ambler 22 01 2006 15 28
Assume that the columns, from left to right, represent one character variable (town name) and five numeric variables (town number, month, year, low daytime temperature (in degrees F) and high daytime temperature (in degrees F)).
a. Use column input to read the data ino a permanent SAS data set by reading the data instream. Print the data set.
b. Create a temporary SAS data set from the permanent SAS data set created in part (a). Print the data set.
creat one permanent library in your C drive
to read and write sas datasets.
a. Use column input to read the data ino a permanent SAS data set by reading the data instream. Print the data set.
SAS Code is give below
libname mylib 'C:\My SAS Datasets';
data mylib.ds1;
input town_name $ 1-6 town_no 8-9 month 11-12 year 14-17 low_ temp 19-20 high_temp 22-23;
cards;
Kane 20 12 2005 12 25 Ambler 22 12 2005 8 20 Kane 20 01 2006 13 32 Oakey 32 12 2005 30 50 Oakey 32 01 2006 25 45 Ambler 22 01 2006 15 28
;
run;
proc print data=mylib.ds1;
run;
Solutionb:
Create a temporary SAS data set from the permanent SAS data set created in part (a). Print the data set.
use set statement
SAS Code is given below:
data ds2;
set mylib.ds1;
run;
proc print data=ds2;
run;
Get Answers For Free
Most questions answered within 1 hours.