Hi guys,
suppose to have the following dataset (a dummy dataset that reflects real data):
data mytab;
length
Value $15
VAR1 $80
VAR2 $50
VAR3 $50;
infile datalines delimiter='|' missover dsd truncover;
input Value $ VAR1 $ VAR2 $ VAR3 $;
datalines;
8 ( 20.5%)|Overall (*)||
4 ( 10.3%)|ClassA|All|
1 ( 2.6%)||A1|A1
1 ( 2.6%)||A1|A1
1 ( 2.6%)||A1|A1
1 ( 2.6%)||A1|A1
1 ( 2.6%)||A1|A1
1 ( 2.6%)||A2|A2
1 ( 2.6%)|Class345|All|
1 ( 2.6%)||NF1|NF1
;
run;
proc print data=mytab noobs;
run;
As you can see A1 is repeated. Is there a way to get the following?
data mytab1;
length
Value $15
VAR1 $80
VAR2 $50
VAR3 $50;
infile datalines delimiter='|' missover dsd truncover;
input Value $ VAR1 $ VAR2 $ VAR3 $;
datalines;
8 ( 20.5%)|Overall (*)||
4 ( 10.3%)|ClassA|All|
5 ( 13%)||A1|A1
1 ( 2.6%)||A2|A2
1 ( 2.6%)|Class345|All|
1 ( 2.6%)||NF1|NF1
;
run;
proc print data=mytab1 noobs;
run;
In other words I would like to sum over Value for repeated and identical Var2 and Var3.
I thought to add an Index to map repeated values and to sum over them but my issue is that "value" var is char variable and not numeric.
Can anyone help me please?
Thank you in advance