dear SAS experts, I use this Code: * Neues Format für die Berechnung der Durchschnitte für n Monate ;
proc format;
value ytd (multilabel)
1 ='Jan'
1,2 ='Feb'
1,2,3 ='Mar'
1,2,3,4 ='Apr'
1,2,3,4,5 ='Mai'
1,2,3,4,5,6 ='Jun'
1,2,3,4,5,6,7 ='Jul'
1,2,3,4,5,6,7,8 ='Aug'
1,2,3,4,5,6,7,8,9 ='Sep'
1,2,3,4,5,6,7,8,9,10 ='Oct'
1,2,3,4,5,6,7,8,9,10,11 ='Nov'
1,2,3,4,5,6,7,8,9,10,11,12 ='Dec'
;
run;
proc format;
value miz
1 = 'Jan'
2 = 'Feb'
3 = 'Mar'
4 = 'Apr'
5 = 'Mai'
6 = 'Jun'
7 = 'Jul'
8 = 'Aug'
9 = 'Sep'
10 = 'Oct'
11 = 'Nov'
12 = 'Dec'
;
run;
* Berechnung der monatlichen Summen, FIL Ebene ;
proc summary data=Dashboard_Primaerdaten nway;
class marktregion_bt nlbez_bt mbrbez_bt filbez_bt FILHB_BT jahr ;
class monat ;
var ORB: NGS: DrK: ;
output out=FIL1 sum=;
run;
proc sort data=FIL1; by marktregion_bt nlbez_bt mbrbez_bt filbez_bt FILHB_BT jahr monat; run;
data FIL2 (drop=Monat);
set FIL1;
format monat miz.;
Monat_2 = cats(jahr,monat,'Somme');
run;
* Berechnung der monatlichen Durchschnitte, FIL Ebene ;
proc summary data=FIL1 nway;
class marktregion_bt nlbez_bt mbrbez_bt filbez_bt FILHB_BT jahr;
class monat/mlf;
var ORB: NGS: DrK: ;
output out=FIL3 mean=;
format monat ytd.;
run;
data FIL3 (drop=monat);
set FIL3;
Monat_2 = cats(jahr,monat,'Moy');
run;
* Berechnung der jährlichen Summen, FIL Ebene ;
proc summary data=Dashboard_Primaerdaten nway;
class marktregion_bt nlbez_bt mbrbez_bt filbez_bt FILHB_BT jahr ;
var ORB: NGS: DrK: ;
output out=FIL4 sum=;
run;
data FIL4;
set FIL4;
Monat_2 = cats(jahr,'Jahr');
run; The variable Monat is numeric and has values from 1 to 12. My Problem is the result of MONAT_2. In the dataset FIL2 I get the following : 20201Somme (Year = 2020, Month = 1) In the Dataset FIL3 I get the following: 2020JanMoy I would like the result in FIL2 to be similar to : 2020JanSomme (instead of 20201Somme) What should I modify to obtain this result? Regards PY
... View more