I'm trying to do a left join from a table I have in my SAS work libref and an extraction from Oracle but it gives an error message.

Here is my code:

```
PROC SQL;
connect to oracle(user=&usuario pass=&pass_dwhprd path='@dtm');
create table base_rateio1 (compress=yes reuse=yes) as
select B.* from connection to oracle
(select 
       A.*,
       substr(B.exem_cod_sog_scv,3,4)  projeto

  from       work.BASE_KPI3_2     A
  left join  exo_ing_ems@lkdwh    B 

where  exem_cod_cia >= 1
   and exem_cod_idt_fil >= 1
   and A.apolice  = B.exem_apo_num
   and A.contrato = B.exem_ctrs_cod
   and A.filial   = B.exem_cod_idt_fil
   and A.cod_cia  = B.exem_cod_cia
   and B.exem_ems_cod = 1
)
as t1;
disconnect from oracle;
quit;

```

And here is the error message:

```
 ERROR: ORACLE prepare error: ORA-00905: missing keyword. SQL statement: select A.*, substr(B.exem_cod_sog_scv,3,4) projeto from 
       work.BASE_KPI3_2 A, left join exo_ing_ems@lkdwh B where exem_cod_cia >= 1 and exem_cod_idt_fil >= 1 and A.apolice = 
       B.exem_apo_num and A.contrato = B.exem_ctrs_cod and A.filial = B.exem_cod_idt_fil and A.cod_cia = B.exem_cod_cia and 
       exem_ems_cod = 1.

```

I really don't know what is the problem