****************************************************************************************************
****************************************************************************************************
* PROGRAM: ms_shaveinside.sas
* Created (mm/dd/yyyy): 07/31/2014
* Last modified: 07/31/2014
*--------------------------------------------------------------------------------------------------
* This program will identify overlapping claims and trim exposure that is inside the
* -Dataset containing the period that claims must overlap
* -Dataset containing the claims that must overlap the reference period
* -Dataset containing the shaved claims
* -reffile = Dataset containing the periods that claims must overlap
* -refstart = variable name containing the date claims cannot go before
* -refend = Variable name containing the date claims cannot go beyond
* -ToShaveFile = Dataset containing the claims that must overlap the reference period
* -ToShaveStart = Variable containing the begin date of the claims to be shaven
* -ToShaveEnd = Variable containing the end date of the claims to be shaven
* -outfile = Output dataset containing the shaved claims
*--------------------------------------------------------------------------------------------------
* Mini-Sentinel Coordinating Center
*--------------------------------------------------------------------------------------------------
* Version Date Initials Comment (reference external documentation when available)
* ------- -------- -------- ---------------------------------------------------------------
***************************************************************************************************;
%macro ms_shaveinside( reffile=,
%put =====> MACRO CALLED: ms_shaveinside v1.0;
%if %str("&id.") ne %str("") %then %let id2=,&id.;