I've imported two datasets from excel ('Current_IC' and 'Current_EC') and want to combine the two datasets to create a new table called CurrentData. The issue is that I've defined a variable, 'Combined', that will take on the values 'Both', 'IC', or 'EC'. If the variable = 'Both' then i want to combine the two datasets. If it's 'IC' I only want to put in 'Current_IC' to the CurrentData table, and if it's 'EC' then I only want to add 'Current_EC'. I don't know how to add an if statement to accomplish this. Below is the code I have to combine the two sets but how do I add an if statement?
Data CurrentData;
Set Current_IC Current_EC;
Run;
If the variable 'Combined' = IC then the code would be
Data CurrentData;
Set Current_IC;
Run;
Any help with this would be great.