sas - 使用直通执行 SAS 代码时出错
问题描述
我正在尝试运行下面的代码,但它返回错误,我已经检查了语法,它似乎没有错,但错误仍然存在
proc sql;
connect to oracle as BD (user = &varUserDBRtdbm.
password = &varPassDBRtdbm.
path = &varPathRtdbmProd.);
select *
from connection to BD
(select *
from (select *
from rtdbm.base_atendimento
where trim(dat_abertura) not in ('NA', 'A')
and UPPER(trim(cod_caso)) not in ('123','N/A','NA','DIGITAL', '001','NULL','DIGITAL','TESTE','LUCAS')
and trunc(to_date(dat_abertura,'DD/MM/RRRR HH24:MI:SS')) >= to_date('01/08/2020','DD/MM/RRRR HH24:MI:SS')
) a,
rtdbm.base_oferta b
where a.cod_caso = b.cod_caso) BY BD;
disconnect from BD;
quit;
出现的部分错误:
) a,
66 rtdbm.nba_tra_oferta b
67 where a.cod_caso = b.cod_caso) BY BD;
__
22
76
ERROR 22-322: Syntax error, expecting one of the following: ',', GROUP, HAVING, ORDER, WHERE.
ERROR 76-322: Syntax error, statement will be ignored.
解决方案
去除BY BD
您的代码是结构化的
select * from connection to BD
(
...
)
by BD;
by <connection>
用于Proc SQL
EXECUTE
声明,此处不需要。
推荐阅读
- git - 如何使用 Jenkins Freestyle Project 访问远程 Git 存储库
- r - 使用 rvest 进行网络抓取:用 NA 替换 html_nodes 的缺失值
- string - SQLite 连接
- cmake - 为现代 CMake 中的所有目标导出编译器标志
- sql - 在 oracle 中的更新表上未调用触发器
- graphics - 使用栅栏清理命令缓冲区并同时同步交换链图像
- javascript - Electron - 从 Menu 向渲染器发送自定义事件
- jenkins - 无法通过 XPath 提取浮点值:/report/counter[@type='INSTRUCTION']/@missed Jenkins 构建中的失败问题
- sql - Spring Data JPA 喜欢或包含
- r - 创建一个变量并使用现有变量在 R 中的循环内添加到数据框