The following is the SAS code to generate the dataset. The lines starting with * are the command lines. Before each code, documentation is given to understand what this is actually doing.
* First create a dataset which gives the total sales for
* each of the subsidiary for every region. The output dataset
* should be unique at subsidiary*region level. The variable
* total_sales_sub denotes the total sales for that subsidiary;
data tot_sale_per_sub;
set sashelp.shoes;
by region subsidiary;
retain total_sales_sub 0;
if first.subsidiary then total_sales_sub = 0;
total_sales_sub+sales;
if last.subsidiary then output;
keep region subsidiary total_sales_sub;
run;
* The dataset 'sales_gt_20pct' is our final dataset where we
* put only those subsidiaries for which total sales is atleast
* 20%=1/5 of the total sales of the region. The variable total_sales_sub
* denotes the total sales for that subsidiary and total_sales_reg
* denotes the total sales for that region;
proc sql;
create table sales_gt_20pct as
select region, subsidiary, total_sales_sub, sum(total_sales_sub) as total_sales_reg
from tot_sale_per_sub
group by region
having total_sales_sub >= total_sales_reg/5;
quit;
* Printing the output data;
proc print data=sales_gt_20pct; run;
* END OF CODE;
To learn more about SAS data code, click the links.
brainly.com/question/15062427
#SPJ4