Does anyone have any idea on how to solve this? I have no clue and need desperate help!! The data set that is produced below contains 90 observations, 9 groups of 10 obs. where each group is defined by the Country*MktSeg combination. The task is to create SAS code that will produce samples where, 1. The naming convention for the sample data sets follows its corresponding country*mktseg*tech<n> 2. For each sample, tech<n>_flag_now variable contains a 50/50 ratio of 0’s and 1’s (using all 1’s, and if the count of 1’s > count 0’s, then 50/50 ratio condition can be dismissed). 3. Define the variable “mt” as “CS_tech<n>” if Tech<n>_flag_prior = 0 and “UP_tech<n>” otherwise. %let Country = BRASIL JAPAN USA; %let MktSeg = ENT SP SMM; %macro crt_ds(ds); data &ds.; %do i = 1 %to 3; _Country= scan("&Country.",&i); %do j = 1 %to 3; _MktSeg= scan("&MktSeg.",&j); /*do ModelType='U','C','A';*/ %do tech_indx = 1 %to 10; Tech1_flag_prior = int(2*ranuni(77777)); Tech2_flag_prior = int(2*ranuni(55555)); Tech1_flag_now= int(2*ranuni(123456)); Tech2_flag_now = int(2*ranuni(99999)); output; %end; %end; %end; run; %mend crt_ds; %crt_ds(test);
... View more