Macro Problem

How to Write some macro code to do a PROC FREQ on a dataset called TEMP, running the macro 3 times to produce tables for variables A, B and C. Use variable D to weight the results. The weight, the name of the dataset and the names of the variables should be parameterised, so this macro could be used for any variables on any dataset