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
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).
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.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.