If you don't have many variables, try this one,otherwise try PROC TRANSPOSE .
data have;
input Country:$3. Month:$3. year Apples Oranges Mango ;
cards;
USA Jan 2018 0 3 0
USA Jan 2018 1 1 0
USA Feb 2018 1 0 1
USA Feb 2018 0 2 2
USA Feb 2018 0 0 1
;
data want;
set have(keep= Country Month year Apples rename=(Apples=number) in=ina)
have(keep= Country Month year Oranges rename=(Oranges=number) in=inb)
have(keep= Country Month year Mango rename=(Mango=number) in=inc);
length type $ 80;
if ina then type='Apples';
if inb then type='Oranges';
if inc then type='Mango';
run;
... View more