- data test;
- input id fuwu freq;
- informat fuwu yymmdd10.;
- format fuwu yymmdd10.;
- cards;
- 1 2025/1/1 1
- 1 2025/3/28 2
- 1 2025/4/23 3
- 1 2025/5/19 4
- 1 2025/6/14 5
- 6 2025/1/5 1
- 6 2025/3/28 2
- 6 2025/4/23 3
- 6 2025/5/19 4
- 6 2025/6/14 5
- 11 2025/1/6 1
- 11 2025/6/14 2
- 13 2025/3/6 1
- 14 2025/2/2 1
- 14 2025/3/2 2
- 14 2025/4/2 3
- 17 2025/3/2 1
- 17 2025/3/28 2
- 17 2025/4/23 3
- 17 2025/5/19 4
- 17 2025/6/14 5
- 17 2025/7/10 6
- 17 2025/8/5 7
- ;
- run;
- /* 计算最大重复数 */
- proc sql noprint;
- create table want1 as
- select id, fuwu, freq, max(freq) as max
- from test
- group by id
- order by id, fuwu
- ;
- quit;
- /* ID唯一号 */
- proc sort data=want1;
- by id;
- run;
- data want(drop=i);
- set want1;
- by id;
- i=1;
- if first.id then id_only+i;
- run;


雷达卡




京公网安备 11010802022788号







