1
votes

I have little to no experience in SAS. But what I would like to do is read in 2 excel spreadsheets into 2 separate temporary datasets.

The files names are C:\signature_recruit.xls and C:\acceptance_recruit.xls.

How do I accomplish this?

2

2 Answers

3
votes

For simplicity, you will want your excel files to look like a SAS data set. That means that you should only have rows and columns of data. If desired, the first row can be the names of the columns(variables).

Now you can either write proc import code yourself to read the excel file, or you can use the Import wizard to click through the process. This has a helpful feature in that after you click though dialog, you can have it save a program that contains the proc import code that the wizard generated to read the excel file. You can then save and reuse this code if needed.

To start the import wizard, go to File->Import Data. The default option is to import an Excel file. Browse to the spreadsheet and answer the questions. Repeat for both spreadsheets.

With luck, this should be all you need to do to get the file into SAS. Here is a link to some more info and examples.

1
votes

An alternative to cmjohns PROC IMPORT approach above is to use DDE. It's an older technology and is more difficult to use but it does provide greater flexibility for complex scenarios.

Plenty has been written on doing this. For example:

http://www.lexjansen.com/wuss/2010/DataPresentation/3015_4_DPR-Smith.pdf

Cheers Rob