楼主: 乾坤神龙
3789 20

关于字符提取 [推广有奖]

11楼
tj0412ymy 发表于 2012-5-22 12:00:31
乾坤神龙 发表于 2012-5-22 10:57
这位老大,非常感谢你的帮助;
对于C=TRANSLATE(B,'',A);
这个作用机制还是有点不明白,希望得到您的指 ...
Translate是替换字符串函数,将A在B中的部分替换为''。
对SAS和统计方面感兴趣的朋友,请加SAS学习和认证讨论群:169157207。欢迎在群上讨论!

12楼
乾坤神龙 发表于 2012-5-22 13:05:30
tj0412ymy 发表于 2012-5-22 12:00
Translate是替换字符串函数,将A在B中的部分替换为''。
感谢您的指导!!

13楼
chendonghui1987 发表于 2012-5-22 15:28:33
TRANSLATE(source,to-1,from-1 <,...to-n,from-n>)  



source
specifies the SAS expression that contains the original character value.

to
specifies the characters that you want TRANSLATE to use as substitutes.

from
specifies the characters that you want TRANSLATE to replace.

14楼
乾坤神龙 发表于 2012-5-22 15:29:13
chendonghui1987 发表于 2012-5-22 15:28
TRANSLATE(source,to-1,from-1 )
感谢感谢!!

15楼
sunset1986 发表于 2012-5-22 17:29:00
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽

16楼
sunset1986 发表于 2012-5-22 17:32:18
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽

17楼
乾坤神龙 发表于 2012-5-23 09:47:30
sunset1986 发表于 2012-5-22 17:32
data c;
        set a;
        C=substr(B, length(A)+1,(Length(B)-Length(A)));
感谢感谢,两种方法都很好!!

18楼
sunset1986 发表于 2012-5-23 09:56:54
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽

19楼
龙潭丰乐 学生认证  发表于 2012-11-15 18:39:22
tj0412ymy 发表于 2012-5-21 19:13
请教老师  x_sub=substr(x,length(x)-4,5)意思是从第十六个字符开始提取5个?

20楼
lily83322 发表于 2012-11-16 14:33:16
compress一下

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-11-17 04:31