SAS合并多个表

编程入门 行业动态 更新时间:2024-10-24 10:18:43
本文介绍了SAS合并多个表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我想知道合并多个表的最佳方法是什么.我在所有表中都有一个唯一标识符.我应该在对表格进行排序后一步加入所有表格,还是应该逐一合并表格.这有关系吗?

I would like to know what is the best way to merge multiple tables. I have a unique identifiers across all the tables. Should I join all the tables in one step after sorting the tables OR should I should do stepwise one by one table merging. Does this matter ?

推荐答案

您可以在一个步骤中进行多个合并.然而,这并不是最安全的方式.如果您的数据可能存在缺陷,最好逐步执行此操作.恕我直言,最好在当时合并一个步骤,但这是你的决定.

You can do multiple merges at single step. However, this is not the safest way. If there is possibility that your data is subject to imperfections, it is best to do this step by step. Imho, it is best do merge a step at the time, but it's your call.

proc sort data=data1; by id; run; proc sort data=data2; by id; run; proc sort data=data3; by id; run; data combo; merge data1(in=a) data2(in=b) data3(in=c); by id; if a and b and c; /*Inner join. Change as needed. */ run;

这相当于:

data partial; merge data1(in=a) data2(in=b); by id; if a and b; run; data combo; merge partial(in=a) data3(in=b); by id; if a and b; run,

更多推荐

SAS合并多个表

本文发布于:2023-10-25 14:14:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1527194.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   SAS

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!