Thursday, December 24, 2015

Handling the look up table using proc SQL

/*******************************************************************/
/*   The program below is to select the observations with          */
/*   questionable STLFRQ1N                                         */
/*******************************************************************/

proc sql;
  ***Create a look up table;
  create table abnormal as
  select distinct stysid1a,stlfrq1n
  from dm.asm_2
  where stlfrq1n >=11;

  ***Select records based on the look up table;
  create table abnormal2 as
  select stysid1a, asm1d, stlfrq1n
  from dm.asm_2
  where stysid1a in (select stysid1a from abnormal) and stlfrq1n ne . ;
quit;

No comments:

Post a Comment