楼主: scarfacetony
2504 7

[问答] 求解这个程序的答案 [推广有奖]

  • 2关注
  • 2粉丝

已卖:182份资源

讲师

83%

还不是VIP/贵宾

-

TA的文库  其他...

从零开始

数据分析书籍资料

他山之石

威望
0
论坛币
3204 个
通用积分
10.4430
学术水平
12 点
热心指数
13 点
信用等级
13 点
经验
35345 点
帖子
254
精华
0
在线时间
829 小时
注册时间
2012-2-16
最后登录
2020-2-26

楼主
scarfacetony 发表于 2012-11-22 18:21:45 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
data short;
input x;
datalines;
1
2
;
run;
data long;
input x;
datalines;
3
4
5
6
;
run;
data new;
set short;
output;
set long;
output;
run;


为什么生成的NEW数据集,只有4行?而且结果是  1 3 2 4 ……

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:output outpu Short Lines Input 程序

看了这个视频,我于是有了进股市的信心!
https://bbs.pinggu.org/thread-2787427-1-1.html

沙发
scarfacetony 发表于 2012-11-23 09:48:11
不知道通过审核了没有,先自己顶下……
看了这个视频,我于是有了进股市的信心!
https://bbs.pinggu.org/thread-2787427-1-1.html

藤椅
davil2000 发表于 2012-11-23 10:39:32
there exists 2 data loops,  for the data set having less obs contains only 2 obs.
In loop 1, the system read in x=1 and x=3 sequentially;
In loop 2, the system read in x=2 and x=4 sequentially.
已有 3 人评分学术水平 热心指数 信用等级 收起 理由
a6566792 + 1 + 1 + 1 热心帮助其他会员
scarfacetony + 1 + 1 + 1 多谢分享
ziyenano + 1 + 1 + 1 精彩帖子

总评分: 学术水平 + 3  热心指数 + 3  信用等级 + 3   查看全部评分

R是万能的,SAS是不可战胜的!

板凳
pobel 在职认证  发表于 2012-11-23 11:06:12
Actually there are 3 data iterations:

_N_=1:  read the first record from short(x=1), then output;
             read the first record from long(x=3), then output;

_N_=2:  read the second record from short(x=2), then output;
             read the second record from long(x=4), then output;

_N_=3: try to read the next record from short but none available, the DATA Step stops.
已有 3 人评分学术水平 热心指数 信用等级 收起 理由
a6566792 + 1 + 1 + 1 热心帮助其他会员
scarfacetony + 1 + 1 + 1 多谢分享
ziyenano + 1 + 1 + 1 精彩帖子

总评分: 学术水平 + 3  热心指数 + 3  信用等级 + 3   查看全部评分

和谐拯救危机

报纸
liyichen17 在职认证  发表于 2012-11-23 11:15:11 来自手机
嗯嗯,学习了

地板
scarfacetony 发表于 2012-11-23 13:34:49
多谢楼上两位大神解答
看了这个视频,我于是有了进股市的信心!
https://bbs.pinggu.org/thread-2787427-1-1.html

7
wangfengxi 发表于 2013-1-24 01:38:33 来自手机
双set有意思

8
tangliang0905 发表于 2013-1-24 02:37:59
so if switch the position of "short" and "long"

data new;
set long;
output;
set short;
output;
run;

there will be 5 obs instead of 4.

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

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