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

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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