Hi everyone, I have the following code where I have to print a list of all Models and the corresponding Prices that were not purchased (files are attached): /*Checking contents*/
title "Contents of Inventory dataset";
proc contents data=BSTA445.inventory;
run;
title;
title "Contents of Purchase dataset";
proc contents data=BSTA445.purchase;
run;
title;
/*Sort Inventory and Purchase datasets by Model*/
proc sort data=BSTA445.inventory;
by Model;
run;
title "Sorted Inventory dataset";
proc print data=BSTA445.inventory;
run;
title;
proc sort data=BSTA445.purchase;
by Model;
run;
title "Sorted Purchase dataset";
proc print data=BSTA445.purchase;
run;
title;
/*Merge 2 sorted datasets*/
data notpurchased;
merge BSTA445.inventory (in=InInvent) BSTA445.purchase (in=inPurch);
by Model;
if InInvent and not InPurch;
keep Model Price;
run;
title "List of unpurchased Models and respective Prices";
proc print data=notpurchased noobs;
run;
title; I want to convert the above program into a Macro called bike_sale with the following three macro parameters: DSN1 as “Inventory" DSN2 as “Purchase” Sold as “whether the bike was sold or not" Use Mprint option. Run MACRO as: %bike_sale(inventory, purchase, not) I'm taking a SAS programming course and this is my very first programming class. I understand that to use Macro, I'd have to replace any texts containing "Inventory" with &DSN1, "Purchase" with "&DSN2" in the above code. However, can anyone please explain to me where I am supposed to replace "Sold" with? Thank you a lot for your help!
... View more