BookmarkSubscribeRSS Feed
ethoma12002
Calcite | Level 5

Hi. I'm just learning this program as part of a class.  I have watched numerous videos and reading the text books.   The first assignment was just to get SAS to read a simple csv file.   But with the online SAS Studio, I just imported it and SAS created the program to read it.   So I didn't really learn anything on that assignment.


I want to use that table that was in the Output screen to create a data set to only pick up particular rows of information.

 

In the videos I'm watched, they use the data sets called "cars" and other things that are in the "My Libraries" folder.  But how do I get my dataset in that folder in order to open it?   I will be stuck again when it comes to picking the rows I want, but as long as I can figure out how to actually tell SAS that I want to use that particular output table is what I'm trying to understand now. 

2 REPLIES 2
SuryaKiran
Meteorite | Level 14

Hello,

 

Welcome to SAS Community!

 

Import in SAS Studio will show you the proc import procedure to read the data, instead of PROC IMPORT learn to read the data using infile in datastep. You will have more control over the data by this way and also you can use the filters that you wish. 

 

For example:

data cars;
infile '/user/myfiles' delimiter=',' missover firstobs=2 dsd lrecl=32767;
input  Name $15. Sex $1. Age 8. Weight 8. Height 8.;
if Age>13;
run;

 

Did you learn about LIBNAME statement? When you have the datasets located in a physical path then you need to assign a libname to reference those datasets in SAS.

 

For example, if you have the cars dataset (cars.sas7bdat) physically located in '/user/mydatasets' folder then the libname for this will be:

Libname mylib '/user/mydatasets';

Now, you can access the dataset by referencing the libname.

proc print data=mylib.cars;
run;
Thanks,
Suryakiran
Cynthia_sas
Diamond | Level 26
HI:
It's not clear to me what class you're following or what video you're watching. Are you using one of the SAS e-learning classes, like Programming 1 or Statistics 1?

In the newest Programming 1 course, for example, we show the difference between using PROC IMPORT for a CSV file and then also show writing a DATA step program to read a CSV file.

If you are using Programming 1 or Statistics 1, we provide instructions for how to make the data used in each class and how to create a SAS library. What class, exactly are you working in? What video in what lesson did you watch? What was the title of the video? Was it from our e-learning class or a YouTube video or provided by your instructor?

Cynthia

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

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
  • 2 replies
  • 1807 views
  • 0 likes
  • 3 in conversation