SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Create a data set to be referenced that lives in SAS

Reply
Contributor
Posts: 32

Create a data set to be referenced that lives in SAS

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

 

 

Super User
Posts: 17,829

Re: Create a data set to be referenced that lives in SAS

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). 

Super User
Posts: 10,500

Re: Create a data set to be referenced that lives in SAS

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.

Ask a Question
Discussion stats
  • 2 replies
  • 246 views
  • 0 likes
  • 3 in conversation