/************************************************************************ This example shown below does not utilize all of the PROC ACCESS options. Complete documentation for PROC ACCESS is available at CSCAR. UofM affiliates are encouraged to visit CSCAR and browse the SAS manual collection. --------------------- CREATES AN ACCESS DESCRIPTOR AND A VIEW DESCRIPTOR FROM AN EXCEL FILE. THEN IT CREATES A SAS DATASET FROM THAT VIEW DESCRIPTOR. THE ACCESS DESCRIPTOR DEFINES THE EXCEL FILE TO SAS...OPTIONS ARE GIVEN FOR THE EXCEL FILE. THE VIEW DESCRIPTOR TELLS SAS WHICH SPECIFIC VARIABLES ARE TO BE INCLUDED. A SAS DATA SET CAN BE MADE FROM THE VIEW DESCRIPTOR. THIS WORKS IN SAS VERSION 6.11, BUT NOT IN VERSION 6.10. ************************************************************************/ libname library v611 'c:\temp'; /* assign a libname to store sas datasets and formats catalogs */ proc access dbms=xls; create library.xlsa.access; /* create access descriptor */ path='c:\temp\dataset.xls'; /* path to excel worksheet */ *worksheet=sheet1; /* select sheet1 to sheet16 for excel 5 workbooks */ getnames=yes; /* get variable names from row 1 */ assign=yes; /* automatically shorten long variable names and replace illegal characters with underscores */ unique=yes; /* automatically resolve duplicate variable name conflicts */ *scantype=yes; /* scan the data to determine type and format */ create library.xlsv.view; /* create view descriptor */ select all; /* select all variables */ run; data library.sasdata; /* create a permanent SAS dataset */ set library.xlsv; /* read data from view descriptor */ run;