Write a SAS program to import the tips.xls data. Name the resulting SAS dataset "tips" and store it in the temporary work library.
Examine the table (dataset) properties and then specify the informat of the variable DELIVERY.
Sol:
proc import in sas is used to import a excel file.
datafile= tells SAS where to find the Excel file that you want to import
out=work.tips tells sas to create a dataset named tips stored in work library
dbms=xls tells sas the excel format file to read
replace is used to overwrite the tips dataset if it exists already
sheet="sheet1" tells SAS to import data from sheet1
getnames="yes"tells SAS to use the first row of data as variable names.
Write a SAS program to import the tips.xls data. Name the resulting SAS dataset "tips" and store it in the temporary work library.
SAS Code is:
proc import datafile="C:\tips.xls" out=work.tips
dbms=xls
replace;
sheet="sheet1";
getnames=yes;
run:
Examine the table (dataset) properties
SAS Code is
Proc contents data=work.tips;
run:
and then specify the informat of the variable DELIVERY.
SAS Code is
proc format
library=work.formats fmtlib;
select DELIVERY.;
run;
Get Answers For Free
Most questions answered within 1 hours.