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

data surrg.male_exposure2;
set surrg._male_exposure1;
if rect_exp = "1" OR rect_interc = "1" then rectal_exposure = "Yes";
else rectal_exposure = "0";
run;

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

This should give you the overlapping conditions:

proc freq data=surrg.merged_male_exposure2;
  tables rect_exp* rect_interc* rectal_exposure /missing list ;
run;

View solution in original post

5 REPLIES 5
PaigeMiller
Diamond | Level 26

Why do you think anything is wrong with it? Can you show us either the SASLOG, or results that are different than what you expect(and explain)?

--
Paige Miller
Dhana18
Obsidian | Level 7

260 data surrg.merged_male_exposure2;

261 set surrg.merged_male_exposure1;

262 if rect_exp = "1" OR rect_interc = "1" then rectal_exposure = "Yes";

263 run;

NOTE: There were 3439 observations read from the data set SURRG.MERGED_MALE_EXPOSURE1.

NOTE: The data set SURRG.MERGED_MALE_EXPOSURE2 has 3439 observations and 206 variables.

NOTE: DATA statement used (Total process time):

real time 0.50 seconds

cpu time 0.07 seconds

 

I did a frequency analysis of rect_exp there are 410 patients with that exposure and rect_interc has 263 patients and after this code there should be 473 rectal exposure but it only give me 425.  That is wrong.

PaigeMiller
Diamond | Level 26

Some patients have BOTH rect_exp='1' and rect_interc='1'

--
Paige Miller
ballardw
Super User

This should give you the overlapping conditions:

proc freq data=surrg.merged_male_exposure2;
  tables rect_exp* rect_interc* rectal_exposure /missing list ;
run;
novinosrin
Tourmaline | Level 20

syntactically my eyes can't notice anything

logically i don't know

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

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1709 views
  • 0 likes
  • 4 in conversation