楼主: peijiamei
1847 5

[原创博文] 表格1怎么生成表格2? [推广有奖]

已卖:299份资源

学科带头人

75%

还不是VIP/贵宾

-

威望
3
论坛币
26157 个
通用积分
12.7133
学术水平
217 点
热心指数
343 点
信用等级
210 点
经验
75401 点
帖子
1099
精华
1
在线时间
2016 小时
注册时间
2007-11-15
最后登录
2016-3-21

楼主
peijiamei 发表于 2010-7-27 14:07:04 |AI写论文
1论坛币
code
dateint
120010102 
120010103 
1200101050
120010106 
220010102 
220010103 
2200101040
220010105 
220010106 
2200101070
220010108 
220010109 
code
dateint
120010102 
120010103 
1200101050
1200101061
220010102 
220010103 
2200101040
2200101051
2200101062
2200101070
2200101081
2200101092



向高手致敬!
关键词:date code ATE COD int

本帖被以下文库推荐

沙发
hopewell 发表于 2010-7-27 14:07:05
  1. data raw;
  2.         infile datalines missover;
  3.         input code date yymmdd8. int;
  4.         format date yymmdd10.;
  5. datalines;
  6. 1 20010102
  7. 1 20010103
  8. 1 20010105 0
  9. 1 20010106
  10. 2 20010102
  11. 2 20010103
  12. 2 20010104 0
  13. 2 20010105
  14. 2 20010106
  15. 2 20010107 0
  16. 2 20010108
  17. 2 20010109
  18. ;
  19. data out(drop=int rename=(temp=int));
  20.         set raw;
  21.         by code;
  22.         if first.code then call missing(temp);
  23.         temp=ifn(int=0,-1,temp);
  24.         if not missing(temp) then temp+1;
  25. run;
复制代码

藤椅
lianghaibing 发表于 2010-7-27 14:22:59
??????
努力就在今天!

板凳
peijiamei 发表于 2010-7-27 17:07:24
IFN Function介绍
Returns a numeric value based on whether an expression is true, false, or missing.

IFN(logical-expression, value-returned-when-true, value-returned-when-false <,value-returned-when-missing>)


MISSING Function
Returns a numeric result that indicates whether the argument contains a missing value.
Syntax
MISSING(numeric-expression | character-expression)

Arguments
numeric-expression specifies a numeric constant, variable, or expression.
character-expression specifies a character constant, variable, or expression.

CALL MISSING Routine
Assigns missing values to the specified character or numeric variables.
Syntax
CALL MISSING(varname1<, varname2, ...>);


Arguments

varname specifies the name of SAS character or numeric variables.
我的微博:http://t.sina.com.cn/1087192374
欢迎互相加关注!

报纸
zhentao 发表于 2010-7-27 18:41:14
早上有一个相似的程序。

地板
zhentao 发表于 2010-7-27 18:43:55
学习了ifn函数。

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

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