Here is an example doing it in GLM. If you don't understand it, please check your textbook and SAS manual.
data t1;
do gender='M','F';
do smoking='Y','N';
do j=1 to 2000;
x=rannor(123); err=rannor(123);
if gender='M' and smoking='Y' then y=1+1*x+err;
else if gender='M' and smoking='N' then y=2+1*x+err;
else if gender='F' and smoking='Y' then y=2+2*x+err;
else if gender='F' and smoking='N' then y=1+2*x+err;
output;
end;
end;
end;
run;
proc glm data=t1;
class gender smoking;
model y=gender*smoking gender*smoking*x/solution noint;
run;quit;