Hi, I want to create a report with customer value groups, count customers in branch and total share percent of customers - like this: cvg percent branch count A .011 nord 135 B .022 nord . --> this coloums should be output in my report!!! Either with a missing sign or with a zero C .033 nord 21 A .011 south 51 B .022 south . C .033 south . A .011 west 5261 B .022 west 56 C .033 west 2155 A .011 east 10 B .022 east . C .033 east 635 The percentage is always the same, because it is the percentage of total share (in this customer value group). Some customer value groups are empty, because this branch hasn't customers in this customer value group. I will force sas to output a column with a missing value or any entry (e. g. 0), like in the table above. But sas do not output this colums. Here is a functioning example: data kunden; infile datalines delimiter=','; input kwg $1. kunde_key filiale $4.; datalines; A, 1230, Nord A, 1231, Nord B, 1232, Nord A, 1233, Nord C, 1234, Nord D, 1235, Nord C, 1236, Sued D, 1237, Sued C, 1238, West C, 1239, West A, 12310, West A, 12311, West B, 12312, West C, 12313, East C, 12314, East ; proc sql; create table anz_kun as select kwg, filiale, count(distinct kunde_key) as Anzahl_Kunden from kunden group by filiale, kwg; quit; data anteil; infile datalines delimiter=','; input kwg $1. anteil; datalines; A, 0.1013 B, 0.2021 C, 0.3046 D, 0.0455 ; proc sort data=anz_kun; by kwg; run; proc sort data=anteil; by kwg; run; data anteil_kunden; merge anteil(in=a) anz_kun(in=b); by kwg; if a; run; I need help... how can I handle this problem? Thanks a lot! BR Silke
... View more