12-01-2016 10:07 PM
It is insterting problem, what I understand you want to control the column in output dataset based on the value in the table.
In below example, I tried to keep only column Type when Make='Audi'.
data cars ; set sashelp.cars(obs=10); run; %macro control_column(cond=,keep_list=); data cars_new; set cars; where &cond; keep &keep_list; run; %mend; %control_column(cond=Make='Audi', keep_list=Type);
12-02-2016 09:59 AM
I want to have only the PrevIOPOD_1/PrevIOPOS_1 values based on the studyeye.
I come up with a maybe easier solution. I can split the dataset based on the sutdyeye into two subdatasets. Then I can keep one of the PrevIOPOS_1/PrevIOPOS_1. then I combine them again.