楼主: wenchongange
2541 3

怎样抽取多张表格的最后一行,组合成新表 [推广有奖]

  • 0关注
  • 1粉丝

博士生

29%

还不是VIP/贵宾

-

威望
0
论坛币
435 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
18882 点
帖子
25
精华
0
在线时间
522 小时
注册时间
2008-4-12
最后登录
2020-7-12

楼主
wenchongange 发表于 2010-1-18 14:44:43 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
现在有多张表格,每张记录每个地区的每个城市人口数,最后一行是人口总数。请问怎样编写语言要把这“每个”最后一行抽出来,组成新表呢,而且新表里要有地区名和人口总数?谢谢,急求答案
二维码

扫码加我 拉你入群

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

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

关键词:人口总数 城市人口 急求答案 求答案 人口数 表格 抽取 成新表

回帖推荐

bobguy 发表于4楼  查看完整内容

Use the options ( nobs=last point=last) on set statement. The advantage is read 3 rows instead of 15 rows in the following example. It is much efficient. 28 data t1 t2 t3; 29 do i=1 to 3; 30 output t1; 31 end; 32 do i=1 to 5; 33 output t2; 34 end; 35 do i=1 to 7; 36 output t3; 37 end; 38 run; NOTE: The data set WORK. ...

本帖被以下文库推荐

沙发
xuwei2007 发表于 2010-1-18 14:47:26
用proc SQL 吧

藤椅
gxlzlxs 在职认证  发表于 2010-1-18 14:58:51
1# wenchongange




你最好是把原表放上来

板凳
bobguy 发表于 2010-1-18 23:16:19
wenchongange 发表于 2010-1-18 14:44
现在有多张表格,每张记录每个地区的每个城市人口数,最后一行是人口总数。请问怎样编写语言要把这“每个”最后一行抽出来,组成新表呢,而且新表里要有地区名和人口总数?谢谢,急求答案
Use the options ( nobs=last point=last) on set statement. The advantage is read 3 rows instead of 15 rows in the following example. It is much efficient.


28   data t1 t2 t3;
29      do i=1 to 3;
30         output t1;
31      end;
32       do i=1 to 5;
33         output t2;
34      end;
35       do i=1 to 7;
36         output t3;
37      end;
38   run;

NOTE: The data set WORK.T1 has 3 observations and 1 variables.
NOTE: The data set WORK.T2 has 5 observations and 1 variables.
NOTE: The data set WORK.T3 has 7 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.03 seconds
      cpu time            0.03 seconds


39
40   data lastrows;
41      set t1 nobs=last point=last;
42      output;
43      set t2 nobs=last point=last;
44      output;
45      set t3 nobs=last point=last;
46      output;
47      stop;
48
49      run;

NOTE: The data set WORK.LASTROWS has 3 observations and 1 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
已有 2 人评分经验 论坛币 学术水平 收起 理由
bakoll + 3 + 3 精彩帖子
xuwei2007 + 1 根据规定进行奖励

总评分: 经验 + 3  论坛币 + 3  学术水平 + 1   查看全部评分

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

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