SAS function IMPORT

Last changed: 10 February 2021

For this click File -> Import data and you get:

 

Choose the type of file you want to import (in our case Excel), click Next and choose the file by browsing you catalogue (observe that the extension of the file is .xlsx).

In the next step you choose how the file is saved as SAS-dataset (Choose the SAS destination). You can choose between:

                SASUSER – the file is saved permanently in the SAS library SASUSER

and

                WORK – the file is saved temporarily in the SAS library ‘WORK’ and is deleted when the session is closed.

Usually it is best to choose WORK and save the dataset as permanent dataset when we have seen that the import was successful. Read more about temporary and permanent data sets.

Furthermore you need to specify the name for the file (MEMBER). For the exercise choose to call it ‘indata1’. Click ‘Next’ and ‘Finish’ and your data is imported. Check the log-window to see if the import was done successfully.

If you get an error massage in this step you probably have a version of SAS that does not communicate with Excel (e.g. 32x version of Excel and 64xversion of SAS). Instead you can convert the file to .csv (comma separated) in Excel and then import that file. You can also install or use the PC File Server to overcome this problem.

 


Contact