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-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
  • 817 views
  • 0 likes
  • 3 in conversation