楼主: dxystata
1283 2

如何将x不同取值的个数放入macro中 [推广有奖]

版主

已卖:302份资源

大师

37%

还不是VIP/贵宾

-

TA的文库  其他...

Software

中英文Ebook

R学习

威望
2
论坛币
183395 个
通用积分
15333.1475
学术水平
208 点
热心指数
271 点
信用等级
174 点
经验
298627 点
帖子
5586
精华
1
在线时间
13632 小时
注册时间
2006-6-21
最后登录
2025-12-22

初级学术勋章 初级热心勋章 中级热心勋章 初级信用勋章

楼主
dxystata 发表于 2013-12-3 12:06:39 |AI写论文
50论坛币
  1. data a;
  2. input x y;
  3. cards;
  4. 1 2
  5. 1 1
  6. 1 1
  7. 2 2
  8. 2 2
  9. 1 3
  10. ;
  11. run;
复制代码
如何将x不同取值的个数放入macro中?谢谢!x为2, y为3。

最佳答案

pobel 查看完整内容

proc sql noprint; select distinct count(distinct x),count(distinct y) into : xnum, : ynum from a; quit; %put &xnum &ynum;
关键词:Macro acr CRO Mac Input 如何

本帖被以下文库推荐

沙发
pobel 在职认证  发表于 2013-12-3 12:06:40
proc sql noprint;
  select distinct count(distinct x),count(distinct y) into : xnum, : ynum
  from a;
quit;

%put &xnum  &ynum;
和谐拯救危机

藤椅
bobguy 发表于 2013-12-4 08:02:07
pobel 发表于 2013-12-3 12:38
proc sql noprint;
  select distinct count(distinct x),count(distinct y) into : xnum, : ynum
  from ...
the first distinct is redundant.

proc sql noprint;
  select count(distinct x),count(distinct y) into : xnum, : ynum
  from a;
quit;

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-4 01:57