BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
naeemahb1
Calcite | Level 5

Hello everyone. Can you help with is problem. 

 

Write SAS code to:

  • Read a file called: SOMEDATA.SAS7BDAT  & 
  • Import an Excel data file (CSV) called “CARSMPG.CSV”

after downloading the data files. 

 

Please help. I was not able to find a tutorial for this. A step by step is appreciated. 

 

The desired result is in the attached file.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

You cannot merge these files. They have nothing in common and there's no basis or logic that would be correct to merge them. I suspect you misunderstood the instructions somewhere.

 

If you download the data (sas data set, somedata.sas7bdat) and place it in the myfolders location you created, you can access the data as follows:

 

 

*set path to permanent library;
libname myData '/folders/myfolders/';


*show summary to match Word doc;
proc means data=myData.somedata; 
run;

 

 

View solution in original post

5 REPLIES 5
Reeza
Super User

Importing or accessing files

 

https://video.sas.com/detail/videos/sas-analytics-u/video/4664335810001/accessing-your-existing-data...

 

Merge:

 

https://video.sas.com/detail/video/4572997800001/merging-sas-tables-in-a-data-step?autoStart=true&q=...

 

 

 


@naeemahb1 wrote:

Hello everyone. Can you help with is problem. 

 

Write SAS code to:

  • Read a file called: SOMEDATA.SAS7BDAT  & 
  • Import an Excel data file (CSV) called “CARSMPG.CSV”

after downloading the data files. 

 

Please help. I was not able to find a tutorial for this. A step by step is appreciated. 

 

The desired result is in the attached file.

 


 

 

ballardw
Super User

BTW, CSV files are text files that are in a format that spreadsheet programs can read. They are not "Excel files". Searching for reading Excel files will make things much more complicated than needed.

Reeza
Super User

You cannot merge these files. They have nothing in common and there's no basis or logic that would be correct to merge them. I suspect you misunderstood the instructions somewhere.

 

If you download the data (sas data set, somedata.sas7bdat) and place it in the myfolders location you created, you can access the data as follows:

 

 

*set path to permanent library;
libname myData '/folders/myfolders/';


*show summary to match Word doc;
proc means data=myData.somedata; 
run;

 

 

naeemahb1
Calcite | Level 5
Thank you so much. This is exactly what I needed as I did misunderstand the
assignment directions.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1480 views
  • 2 likes
  • 3 in conversation