** This is the Physician Consultation Visits SAS Code ; data consult ; set med ; where ^(4007<=refmd<=5006) & refmd> 0 tariff in('8500','8595','8557','8556','8553','8440', '4800','8516','4806','8554','8596') _ambvis ; if ambvis = '1' if put(hosp,$pchfmt.) = '0' and put(hosp,$hsptypf.) ^in('9','10'); run;