data sales; input prod $ Jan_Units Feb_Units Mar_Units Jan_Price Feb_Price Mar_Price ; cards; A 408 323 168 10 10 12 B 632 631 100 15 10 14 C 619 677 285 14 15 11 D 846 136 831 15 13 13 E 518 440 630 12 11 13 ; Output Needs to be: Product Jan_Total_sales Feb_Total_sales Mar_Total_sales A 4080 3230 2016 B 9480 6310 1400 C 8666 10155 3135 D 12690 1768 10803 E 6216 4840 8190 run; When I run the below code, data sales2; set sales; array Units[3] Jan_Units-Jun_Units; array Price[3] Jan_Price-Jun_Price; array Total_Sales[3]; do i=1 to 3; Total_Sales[i] = Units[i]*Price[i]; end; run; I get the below error; ERROR: Missing numeric suffix on a numbered variable list (Jan_Units-Mar_Units). ERROR: Too few variables defined for the dimension(s) specified for the array Units. Can someone please advice me in the above mentioned error?
... View more