As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.
Here are some tips for How to share your SAS knowledge with your professional network.
Tip of the Day:January 20
sasCommunity Tip of the Day
data try ; none=0; meds=1; hosp=1; output; none=1; meds=0; hosp=0; output; run; data _null_; set try; list = CatX(', ', IfC( none = 1 , 'NONE' , '' ), IfC( meds = 1 , 'MEDS' , '' ), IfC( hosp = 1 , 'HOSP' , '' )); put list= ; run ;
Let's say you have a set of 0/1 dummy variables that are used to specify the treatments that a patient receives, and let's say that you want to put those treatments into a comma-separated list. This can be achieved using IFC within the arguments of CATX.
The LOG shows:
List=MEDS, HOSP List=NONE
Special thanks to Toby Dunn for suggesting this technique.
Submitted By Otterm1
Feel free to comment on this tip.