SAS for Microsoft 365 enables users to seamlessly integrate the capabilities of SAS with Microsoft applications. This post will illustrate how to upload existing Excel tables to SAS and CAS libraries using SAS for Microsoft 365. While demos in this blog were performed using the desktop version of Excel, they can also be performed in the Excel web app.
I recently visited Glacier National Park and saw a variety of animals including bears, goats, and eagles. Curious to learn more about the animals I saw, I created a table of the most common animals found in Glacier National Park. This table includes information on the species, color, average weight, and average lifespan of each animal. This table is saved in an Excel workbook called Glacier on my desktop and my goal is to upload it to a SAS library called ANIMALS.
Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.
I open the Glacier workbook in Excel, click SAS Viya > Home on the top ribbon, and sign in with my credentials in the SAS Viya pane. I click anywhere on table and click the Upload Data icon.
A box appears that allows me to choose which cells of the table to include (the default is the entire table) and has an option to identify the first row as column names.
Note: If you forget to click on the table before clicking Upload Data, no columns are selected. To fix that, simply click anywhere on the table and select the Update with current Excel selection icon.
The table also displays column properties including the name, label, type, length, and format of each column. You can click a column and the Edit column properties icon to change any of the column properties.
Going back to the Glacier data, I don't want to make any changes to the column properties so I click Upload data and a list of available SAS libraries appears. I select the ANIMALS library as the location for the table, call the table Glacier, and click Save as.
If I wanted to save the table to a caslib, I could click the Create a default CAS session and assign SAS librefs for existing caslibs icon. Available caslibs appear in the list of connected libraries.
Using the Upload data feature allows users to quickly and easily upload existing tables to libraries directly in Excel and does not require any programming to do so. To learn more about SAS for Microsoft 365 please visit SAS for Microsoft 365 | SAS Support.
Find more articles from SAS Global Enablement and Learning here.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.