As the first step in the decommissioning of the site has been converted to read-only mode.

Here are some tips for How to share your SAS knowledge with your professional network.


From sasCommunity
Jump to: navigation, search

SUGI23.170, Poster, 4 pages

%ComparWS: Compare with summary: a macro using Proc Compare to write a file of differences to edit and use for updates

Ronald Fehd,

Centers for Disease Control and Prevention, Atlanta, GA.


Data review can be viewed as a two-step process:

1. Compare: review differences between two data sets.

2. Exception Report: review data consistency with range and logic checks.

A data set may be updated with a file containing sets of these three statements -- ID, assignment and closure:

* if ID = 1 then do;
* <variable name> = <value>;
* end;

This paper reviews the proc COMPARE output data set and the manipulation of that data set which is necessary to write a report to a file which contains update statements in an easily editable form. Summary information is written at the end of the update file. The output file is in this form:

if ID = 1 then do;
* VAR_A = 'A4Q3J';
* VAR_A = 'A4Q8J';
* diff: = '...X.';

where ‘X’ in the value of Dif indicates the position of difference of the values in the Base and Compare data sets.

Keywords: Compare, corrections, macro arrays, nobs, Transpose, updates

See also:

%INVALID: a data review macro
          using Proc Format option other=Invalid
          to identify and list outliers


-- created by User:Rjf2 on 3 October 2009, at 22:11

--Ronald_J._Fehd macro.maven == the radical programmer