楼主: harlon1976
6008 34

[原创博文] 请教这个程序应该如何编写 [推广有奖]

31
bobguy 发表于 2010-3-14 21:54:03
jackbt123 发表于 2010-3-14 12:44
Hi bobguy,
should we consider the duplicate cases?
for instance,
x class
1 A
1 B
Thanks
I think we can in general as long as we define it clearly. It should not be a difficult one.

32
xbmy 发表于 2010-3-17 06:16:37
Learings!

33
xbmy 发表于 2010-3-17 06:17:00
Learnings!

34
醉_清风 发表于 2010-3-17 17:20:07
正在学习中...
从来不需要想起 永远也不会忘记

35
sugx111 发表于 2011-3-12 20:10:19
1# harlon1976


不好意思現醜了
此法的畫順序會被重新排過,不知道有沒有符合您的需求。


兩個變數

data a1;
input x class $1.;
cards;
1      A
5      B
4      A
2      B
8      A
;

data a2;
input x;
cards;
1
4
8
5
2
5
2
8
1
4
;

proc sort data=a1; by x;
proc sort data=a2; by x;
data a3; merge a2 a1; by x;
run;


三個變數


data a1;
input x y class $1.;
cards;
1   1   A
5   3   B
4   4   A
2   7   B
8   9   A
;

data a2;
input x y;
cards;
1 1
4 4
8 9
5 3
2 7
5 3
2 7
8 9
1 1
4 4
;

proc sort data=a1; by x y;
proc sort data=a2; by x y;
data a3; merge a2 a1; by x y;
run;

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-30 05:28