BookmarkSubscribeRSS Feed
SmcGarrett
Obsidian | Level 7

Hello,

 

I have a data set in Excel which lists attributes of about 5000 variables. When I read in data into SAS, I build a dataset and if I need to add these attributes I have to these attributes I do a merge ...similar to a vlookup... to retrieve the additional information from the excel sheet and put it into the SAS data set I'm creating. Is there a way I could read the excel sheet into SAS, and save it in such a way that whenever I need to do a merge or request information from that sheet, it's not tied to the excel sheet? 

 

Garrett

 

 

2 REPLIES 2
Reeza
Super User

Save the dataset in a permanent library. 

 

Libname mydata 'C:\Project1';

Data mydata.attributes;
Set attributes;
Run;

Then the next time you need to use it, create the libname reference and use the saved dataset as (mydata.atteibutes). 

ballardw
Super User

I'm not quite sure if you have ever read this data into SAS. Have you? If so then creating and assigning a permanent library as @Reeza suggests is the way to go.

If you have never  actually read the data into SAS then I would suggest 1) save your spreadsheet as a CSV file. Use the import wizard to import the data. If you have a permanent library with your other data then import it into that library.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 797 views
  • 0 likes
  • 3 in conversation