Hi @Dhana18 , I believe you want to create a report rather than a SAS dataset as you want to display Gender and MSM categories by Alertype as columns. May be you could try Proc Tabulate as shown below. In the Tables statement, you can specify the structure of your report to display statistics: (rows), (columns) * (statistics eg: n to show frequency) proc tabulate data=have out=want;
class AlertType Gender MSM Gender_Sp Race Ethnicity Num_partners Age GCHX SXPharyngeal Discharge Dysuria SXAbdomen;
tables (Gender_Sp Race Ethnicity Num_partners Age GCHX SXPharyngeal Discharge Dysuria SXAbdomen),(AlertType *(Gender MSM))*n;
run; NB: it seems that you have some data management to perform. For example, Alerttype contains "Alert" and "alert" -> proc tabulate is case-sensitive to identify modalities. So I think you can use a proc format for example to avoid these issues and group similar modalities. Or even to overwrite original data if it is allowed. Hope this help.
... View more