I have data like this :
ColumnA ColumnB ColumnC
1 10 20
1 10 30
0 50 10
0 50 20
1 10 40
I want to sum values of ColumnB and ColumnC where the values of ColumnA = 1 and store the result in a variable i.e. I want 120 (sum values of ColumnB and ColumnC where the values of ColumnA = 1) and store this result in a variable in SAS.
With this I also want to (sum values of ColumnB and ColumnC where the values of ColumnA = 0) in another variable i.e. 130 in another variable in SAS
I tried to create a variable in proc print, means,etc. and even thought of doing it in proc sql but was unable to achieve the result.