BookmarkSubscribeRSS Feed
kathrynssy
Calcite | Level 5

I tried to load a simple code PROC FREQ in SAS, create a 2x2 table and calculate relevant statistics and this is what I face:

 

This is the code I input:

 

LIBNAME Lab1 "/home/u61812062/EPID620"
run;
 
proc contents data = lab1.compassign1; 
run;
 
 
proc freq data = lab1.compassign1; 
table exposure * bladderC / cmh relrisk riskdiff; 
run;
 
Anf this is the error I got. I had the compassign1 stored in permanent library (lab1). And variables: exposure and bladderc were variables in the dataset. How come SAS says the variables not found?!
kathrynssy_0-1695146941352.png

 

 

2 REPLIES 2
PaigeMiller
Diamond | Level 26

Variables EXPOSURE and BLADDERC are not in the data set named LAB1.COMPASSIGN1.

 

You need to look at the variable names in that data set carefully to make sure you have typed the variable names properly, and that these variables are really in the data set.

--
Paige Miller
ballardw
Super User

Your code shows that your ran Proc Contents. Where is the output for that procedure?

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

From SAS Users blog
Want more? Visit our blog for more articles like these.
5 Steps to Your First Analytics Project Using SAS

For SAS newbies, this video is a great way to get started. James Harroun walks through the process using SAS Studio for SAS OnDemand for Academics, but the same steps apply to any analytics project.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 158 views
  • 0 likes
  • 3 in conversation