gpt4 book ai didi

sas - 使用 proc sql,其中至少 1 列是一个值

转载 作者:行者123 更新时间:2023-12-01 08:49:13 24 4
gpt4 key购买 nike

sas怎么写:

proc sql; 
create table THIS as
select *
from MAIN(keep=id col1 -- col34)
where (AT LEAST ONE OF THE COLUMNS contains 1) ;
;

我在弄清楚如何写最后一行 bc 时遇到问题,因为我想保留所有列,所以我不只是检查一个列,我想检查所有列。

最佳答案

如果您使用 DATA 步而不是 PROC SQL,您将拥有更大的灵 active ,因为您不能在 PROC SQL 代码中使用变量列表。

假设您列表中的所有变量都是数字,您可以这样做。

data this;
set main ;
keep id col1 -- col34;
if whichn(1,of col1 -- col34);
run;

关于sas - 使用 proc sql,其中至少 1 列是一个值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47039297/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com