%macro dcomp( /* Data compare macro. JGB, start Oct. 2016. This macro looks at two input data sets or possibly a single data set with two filters. These are base and current data. The macro looks at matching observsations per the idvars parm and looks at variables with the same name in the 2 sets. For each variable that gets compared the output set contains a set of variables with names based on the name from the input sets: &dvar_&base, &dvar_¤t, &dvar_change, %dvar_PctCh &dvar_adj (adjusted as with a dollar figure where it gets adjusted to current dollars). */ setinbase= , /* required. Specifies the data set with base data. */ setincur= /* required. Specifies the dataset with current or comparison data. */ basefilter=, /* optional, used to filter observations on setin. Can be either a macro name or a where condition. The macro name must begin with an _ and that is how the macro determine which it is. */ curfilter=, /* optional. Same idea as base filter but used for the current data set. */ setout=, /* required. Name of output data set. If 2-level then libref must be defined. */ ignoremoes=1, /* any variable with name ending _moe is ignored if this option specified. Set to 0 to have these variables compared. */ keepmoes=0, /* set to 1 to keep original _moe values (base and cur) */ compress=yes, /* compress option for output dataset. Values are yes, no, binary . */ sfxbase=base, /* this suffix is appended to variable name to indicate value coming from base datasset */ sfxcur=cur, /* this suffix is appended to variable name to indicate value coming from current dataset */ baseid=,curid=, /* these optional ID values will be appended to the input var names. So if baseid=2010 and basesfx=10 then variable TotPop on the base set will get named TotPop10 with label "Total Population 2010" (assuming Totpop had label Total Population on input set. */ deltasfx=, /* The output dataset has newly created variables with names created from the input variable with Change, PctChange, ChangeInPct appended. You can use this parm to have a suffix appended to these names. E.g. if comparing data for yr1 with yr2 you could have a value with these years ided So you might have a name like TotPopChange10_15 */ compvars=, /* list of variables to be compared. By default all numeric variables appearing on both datasets will be compared. If the value starts with a minus sign (i.e. dash) it means compare all values *except* those specified in this parm. */ runprocc=0, /* Set to 1 to have SAS Proc compare run to generate a report regarding differences of the two input sets regarding variables, labels, etc. To ID problems due to inconsistency of naming, labeling, typing (i.e. storing as numeric vs. character). */ idvars=, /* required. Variables used to match the observations to be compared. Variables must be on both input sets and must be of the same type and length. */ idvars2=, /* optional. Additional variables to be kept on output set but not used as matching keys. E.g. Areaname would often be specified in this list. */ debug=0); %let revdate=%str(10/17/2016 11:33:44 AM);