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

 

if drug=pimozide then ddi1=pimozide;
if drug=ziprasidone then ddi1=ziprasidone;
if drug=selegiline then ddi1=selegiline;
 
drugp="pimozide";
drugp="fluconazole";
drugp="ziprasidone";
 
ddicomb=ddi1||drugp;

 

I want if ddicomb=fluconazole||ziprasidone and ddicomb==ziprasidone||fluconazole as same ddicomb

how can I  make it?  Thank you so much!

 

1 ACCEPTED SOLUTION

Accepted Solutions
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

you may want to use concatenation.  This link may assist you in understanding how to use concatenate.

 

https://stats.idre.ucla.edu/sas/modules/concatenating-data-files-in-sas/

Happy trails Man Happy

View solution in original post

4 REPLIES 4
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

you may want to use concatenation.  This link may assist you in understanding how to use concatenate.

 

https://stats.idre.ucla.edu/sas/modules/concatenating-data-files-in-sas/

Happy trails Man Happy

xinyao
Fluorite | Level 6
Thank you so much!
ChrisNZ
Tourmaline | Level 20

1. Please change the title of your post to something more meaningful

 

2. Did you forget some quotes in your code?

 

3. == is not a valid operator in SAS

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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