如何在SAS查询编辑器的过滤器中引用宏列表
您好Stackoverflow社区。
我需要将过滤器插入SAS Enterprise Guide查询构建器中。
该过滤器应包含大量产品代码的列表,该列的格式是一个字符,但是使用IN Operator将它们一一插入过滤器部分非常耗时。
因此,我正在考虑创建一个SAS大型,并将其引用到查询构建器的过滤器中。在一个示例下,
%LET product_codes =
'815001004490'
'815300465351',
'815100001069',
'815000000152',
'815100000561'
;
我写了一个Proc SQL来检查程序是否给了我退回结果,但是我得到了我期望的
proc sql;
create table want as
select * from library_name.table_name
where product in (&product_codes.)
;
quit;
,但是,当我在SAS查询编辑器中重复相同的过程时,我会拿回一个空表。
我想我缺少一些东西。我知道大型可作为简单的文本生成器。如何解决?有什么想法吗?我在做什么错。
Hello Stackoverflow community.
I need to insert a filter into SAS Enterprise Guide query builder.
This filter should contain a huge list of product codes, the format of this column is a character, but it's very time consuming to insert them one by one into the filter section using the IN operator.
So I was thinking to create a sas macrovariable, and referencing it into the filter of the query builder. Below an example
%LET product_codes =
'815001004490'
'815300465351',
'815100001069',
'815000000152',
'815100000561'
;
I wrote a proc sql to check if the program was giving me back results, and I got what I was expecting
proc sql;
create table want as
select * from library_name.table_name
where product in (&product_codes.)
;
quit;
However, when I repeat the same process in SAS query editor, then I get back an empty table.
I guess I am missing something. I am aware that the macrovariable works as simple text generator. How can this be resolved? any ideas? what am I doing wrong.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我发现了什么问题。
当我在SAS查询编辑器中添加过滤器时,下面有一个小框,要求在双引号之间包括或不包括值。通过这样做,我从查询编辑器的结果中出来
I found out what was the problem.
When I add a filter in SAS query editor, there is a little box below which asks to include or not values between double quotes. by doing that, I came out with a result from my query editor