请选择 进入手机版 | 继续访问电脑版
楼主: bjpucl
10885 25

数据集观测条数几百万条,PROC SORT效率低、占用资源大,如何破? [推广有奖]

  • 0关注
  • 0粉丝

博士生

24%

还不是VIP/贵宾

-

威望
0
论坛币
64 个
通用积分
4.2033
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
23059 点
帖子
229
精华
0
在线时间
274 小时
注册时间
2010-4-8
最后登录
2023-5-10

bjpucl 发表于 2014-1-8 10:55:16 |显示全部楼层 |坛友微信交流群
相似文件 换一批

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
RT,做项目的过程中,有一个数据集有900万条观测(变量为3个),需要使用PROC SORT对其进行排序,且整个处理过程排序次数至少2~3(排序的变量不同)。

实际操作时,实在太慢了,而且占用计算机资源太多,基本上算死机状态,这个有办法破吗?谢谢!
二维码

扫码加我 拉你入群

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

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

关键词:ROC 数据集 SOR 实际操作 计算机 计算机 如何 资源 而且 项目

回帖推荐

sasmixed 发表于5楼  查看完整内容

If you don't mind efficiency, you can change sortsize option. ...... SORTSIZE=memory-specification specifies the maximum amount of memory that is available to PROC SORT. Valid values for memory-specification are as follows: MAX specifies that all available memory can be used. n specifies the amount of memory in bytes, where n is a real number. nK specifies the amount of memory in ...

本帖被以下文库推荐

zhengbo8 发表于 2014-1-8 11:03:39 |显示全部楼层 |坛友微信交流群
hash表,试试。

使用道具

zhengbo8 发表于 2014-1-8 11:04:27 |显示全部楼层 |坛友微信交流群
另外,问一下排序变量多吗,是字符串吗?

使用道具

bjpucl 发表于 2014-1-8 11:10:12 |显示全部楼层 |坛友微信交流群
zhengbo8 发表于 2014-1-8 11:04
另外,问一下排序变量多吗,是字符串吗?
排序的变量不多,只需要对两个变量排序(一个是数值型的,一个是字符型的)。排一次要20分钟,而且计算机基本处于死机状态,我的目的是想尽量“降低硬件资源的占用”,时间长点可以忍受,但是干不了其它事情很杯具。
ps:那个vba中调用sas代码的事情我搞通了,现在就是在excel中调用sas代码进行数据集的排序。多谢之前的帮助哈!

使用道具

sasmixed 发表于 2014-1-8 11:55:14 |显示全部楼层 |坛友微信交流群
If you don't mind efficiency, you can change sortsize option.
......

SORTSIZE=memory-specification
specifies the maximum amount of memory that is available to PROC SORT. Valid values for memory-specification are as follows:

MAX
specifies that all available memory can be used.

n
specifies the amount of memory in bytes, where n is a real number.

nK
specifies the amount of memory in kilobytes, where n is a real number.

nM
specifies the amount of memory in megabytes, where n is a real number.

nG
specifies the amount of memory in gigabytes, where n is a real number.

Specifying the SORTSIZE= option in the PROC SORT statement temporarily overrides the SAS system option SORTSIZE=. For more information about SORTSIZE=, see the chapter on SAS system options in SAS Language Reference: Dictionary.

已有 1 人评分学术水平 热心指数 信用等级 收起 理由
shenliang_111 + 1 + 1 + 1 精彩帖子

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

使用道具

很常见的问题,期待好的答案!!

使用道具

zhengbo8 发表于 2014-1-8 12:28:53 |显示全部楼层 |坛友微信交流群
第一种方法:在proc sort 步 options 选项中,加 sortsize=、tagsort选项。

  1. proc sort data=test tagsort sortsize=200m;
  2.        by x1 x2;
  3. run;
复制代码

sortsize= :用以指定可用最大内存的大小,等号后为表示内存大小的数值及单位,比如10m 。
tagsort:指定在临时文件中仅存储排序变量和记录编号,以减少对磁盘空间的使用。


第二种方法:拆分大数据集成若干小数据集,小数据集排序,再合并。

使用道具

zhengbo8 发表于 2014-1-8 12:28
第一种方法:在proc sort 步 options 选项中,加 tagsort选项。
第二种方法:拆分大数据集成若干小数据集, ...
tagsort选项有啥用?

使用道具

zhengbo8 发表于 2014-1-8 12:35:24 |显示全部楼层 |坛友微信交流群
shenliang_111 发表于 2014-1-8 12:33
tagsort选项有啥用?
详见帖子上一楼。

使用道具

bjpucl 发表于 2014-1-9 10:07:19 |显示全部楼层 |坛友微信交流群
zhengbo8 发表于 2014-1-8 12:28
第一种方法:在proc sort 步 options 选项中,加 sortsize=、tagsort选项。
昨天按照你的方法,在sort过程中增加了选项sortsize=600m、tagsort;同时还修改了sasv9.cfg中的sortsize(之前该值为256m,我改为768m),最终sort过程所花费的时间为45分钟。之前为15~20分钟。不过资源占用方面确实好了一些。

使用道具

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

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-16 16:50