Hallo, I would like to improve the run time of my SAS program. For that I am tryig to translate my SAS code into SQL code. Does anyone knows if there is an aquivalent procedure in SQL for the SAS function compress()? I would like to extract specified ICD codes from a reference list and want eliminiate special characters from the codes (+-!.#*). see code below: PROC SQL; connect to oracle (user=&user. password="&password." path=&path.); create table test as select ID, INP_ID, DIAG from connection to oracle (select ID, INP_ID, DIAG from lib.table_hosp) where (upcase(strip(compress(DIAG,"+-!.#*"))) in (select upcase(strip(compress(ICD_10,"+-!.#*"))) from ref.icd)); disconnect from oracle; QUIT; to improve the run time I would like to perform the query directly in oracle like: PROC SQL; connect to oracle (user=&user. password="&password." path=&path.); execute( create table test as select ID, INP_ID, DIAG from lib.table_hosp where (TRIM(upper(REGEXP_REPLACE(DIAG,'[-!.#*+]',''))) in (select TRIM(upper (REGEXP_REPLACE(ICD,'[-!.#*+]',''))) from ref.icd) and IDNUM in(select PATIENTID from safeguard.Patients_out_dus_cov_mn)) ) by oracle; disconnect from oracle; QUIT; I tried 1000 of possibilities and googled around and found the procedure REGEXP_REPLACE() but nothing works out. Do you have any idea? Thanks in advance! Marie
... View more