Advertisement
leannemcn13

partial dates

Dec 20th, 2016
459
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SAS 0.49 KB | None | 0 0
  1. data pr5;
  2.   set pr4;
  3.  
  4.   *--- create dummy date for PREFL calculation;
  5.     if substr(PRSTDTC,5,1) ne '-' then do;
  6.        PAR_STD=cat(trim(PRSTDTC) || '-01-01');
  7.     end;
  8.  
  9.     if substr(PRSTDTC,8,1) ne '-' and PAR_STD= "" then do;
  10.        PAR_STD=cat(trim(PRSTDTC) || '-01');
  11.     end;
  12.     dumdate= input(PAR_STD, yymmdd10.);
  13.     format dumdate date9.;
  14.  
  15. *--- create PREFL variable;
  16.     if AENDT > . and AENDT <= TRTSDT then PREFL = "Y";
  17.     else if dumdate ne . and dumdate < TRTSDT then PREFL = "Y";
  18.  
  19. run;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement