由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - A question about combine SAS data steps
相关主题
为什么合并这两个数据不能用sas merge 而要用SAS SQL问一下SQL in Python。
[SAS] row mergingSAS data merge求助
[合集] [求助]一个生物统计工作的电话面试用SAS merge Excel cells ?
讲讲最近来我们公司面试的一个小姑娘吧Dataset merge的一个问题
[合集] 讲讲最近来我们公司面试的一个小姑娘吧SAS Macro question, thanks!
[合集] 问个SAS和R的问题SAS Data Merge 一问
请问R Code和 Matlab Code 思路是否近似?请教一个用SAS作DATA MERGE的问题
SAS Question请问:为什么if then 在do loop 中就不起作用了呢?
相关话题的讨论汇总
话题: data话题: run话题: new话题: combine话题: steps
进入Statistics版参与讨论
1 (共1页)
c*****p
发帖数: 51
1
When I combine below first three data steps into one single data step at the
bottom, it generates different results. Can anybody figure out why? Thank
you very much.
data A;
merge X(in=a) Y(in=b);
by key_id;
if a=1;
run;
data A;
set A;
if year<=2006 then id=new_id;
run;
data A;
set A;
drop new_id;
run;
data A(drop = new_id);
merge X(in=a) Y(in=b);
by key_id;
if a=1;
if year<=2006 then id=new_id;
run;
g****8
发帖数: 2828
2
你把 drop放最后试试。

the

【在 c*****p 的大作中提到】
: When I combine below first three data steps into one single data step at the
: bottom, it generates different results. Can anybody figure out why? Thank
: you very much.
: data A;
: merge X(in=a) Y(in=b);
: by key_id;
: if a=1;
: run;
: data A;
: set A;

o****o
发帖数: 8077
3
这两个判断语句换个次序
if a=1;
if year<=2006 then id=new_id;

the

【在 c*****p 的大作中提到】
: When I combine below first three data steps into one single data step at the
: bottom, it generates different results. Can anybody figure out why? Thank
: you very much.
: data A;
: merge X(in=a) Y(in=b);
: by key_id;
: if a=1;
: run;
: data A;
: set A;

1 (共1页)
进入Statistics版参与讨论
相关主题
请问:为什么if then 在do loop 中就不起作用了呢?[合集] 讲讲最近来我们公司面试的一个小姑娘吧
请教两道SAS BASE123 的题目[合集] 问个SAS和R的问题
[合集] 讲讲最近来我们公司面试的一个小姑娘吧请问R Code和 Matlab Code 思路是否近似?
请教关于简历SAS Question
为什么合并这两个数据不能用sas merge 而要用SAS SQL问一下SQL in Python。
[SAS] row mergingSAS data merge求助
[合集] [求助]一个生物统计工作的电话面试用SAS merge Excel cells ?
讲讲最近来我们公司面试的一个小姑娘吧Dataset merge的一个问题
相关话题的讨论汇总
话题: data话题: run话题: new话题: combine话题: steps