SAS-> Shell DB2 直通和宏解析
我正在尝试自动化一项工作,该工作涉及通过网络以及实际 db2 服务器和 SAS 服务器之间传递的大量数据。我想做的是采用传统的方式......
proc sql;
connect to db2(...);
create table temp as
select * from connection to db2(
select
date
.......
where
date between &start. and &stop.
); disconnect from db2;
quit;
进入这样的情况:
x "db2 'insert into temp select date ...... where date between &start. and &stop.'";
我遇到了一些问题,其中第一个问题是 'ddMONyyyy'd 的 db2 日期格式,这会导致 shell 命令提前终止。如果我能解决这个问题,我认为它应该有效。
我可以将宏变量传递到 AIX (SAS) 服务器,而无需执行 db2 命令所需的额外“ ”集。
有什么想法吗?
I'm trying to automate a job that involves a lot of data being passed across the network and between the actual db2 server and our SAS server. What I'd like to do is take a traditional pass through...
proc sql;
connect to db2(...);
create table temp as
select * from connection to db2(
select
date
.......
where
date between &start. and &stop.
); disconnect from db2;
quit;
into something like this:
x "db2 'insert into temp select date ...... where date between &start. and &stop.'";
I'm running into a few issues the first of which is db2 date format of 'ddMONyyyy'd which causes the shell command to terminate early. If I can get around that I think it should work.
I can pass a macro variable through to the AIX (SAS) server without the extra set of ' ' needed to execute the db2 command.
Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过用括号隔开 WHERE 子句来解决日期问题的单引号问题。我不确定这是否有效,但可能值得尝试。
至于 X 命令,请尝试如下所示:
You might get around the single-quote around the date issue by setting off the WHERE clause with a parenthesis. I'm not sure that this will work, but it might be worth trying.
As far as X command, try something like the following: