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

Using SASstudio and I'm unsure how to extract data from certain variables so I can run uni/bivariate analyses on it. I've never worked with such a large file but it was a 7bdat file I imported to SASStudio and I can't figure out how to create a code that will run only using certain selected variables. 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Certain variables? Most of the analysis procedures you would use either a VAR statement.

Proc univariate data=yourdatsetname;
   var thisvar thatvar othervarname; /* list the variables of interest*/
run;

It sort of depends what type of bivariate analysis you intend. Just counts with Proc Freq you place an * between two variables or groups of variables to do bivariate:

proc freq data=yourdataset;
   tables (thisvar thatvar anothervar)*(somevar someothervar somethingelse);
run;

for example would pair each of the variables in the first set of parentheses with each in the second set.

 

 

View solution in original post

4 REPLIES 4
ballardw
Super User

Certain variables? Most of the analysis procedures you would use either a VAR statement.

Proc univariate data=yourdatsetname;
   var thisvar thatvar othervarname; /* list the variables of interest*/
run;

It sort of depends what type of bivariate analysis you intend. Just counts with Proc Freq you place an * between two variables or groups of variables to do bivariate:

proc freq data=yourdataset;
   tables (thisvar thatvar anothervar)*(somevar someothervar somethingelse);
run;

for example would pair each of the variables in the first set of parentheses with each in the second set.

 

 

beleeve
Calcite | Level 5
Is the datasetname referring to the location of the 7bdat file in SAS?
Kurt_Bremser
Super User

To use SAS datasets in program steps, you have two ways:.

  • have a library defined for the directory where the file resides (LIBNAME statement) and use the library.dataset notation to address it. If you omit the library, the file is assumed to be in the temporary library WORK. The dataset name corresponds to the filename without the .sas7bdat extension.
    This is the preferred method.
  • or you use the fully qualified pathname of the file, enclosed in quotes.

sas-innovate-wordmark-2025-midnight.png

Register Today!

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.


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