楼主: 木颜夕
10411 13

SAS base 123中 73、76题疑问 [推广有奖]

11
jcw0705 发表于 2015-8-11 14:04:22 |只看作者 |坛友微信交流群
学习了!感谢~

使用道具

12
上尉格格 发表于 2015-8-24 09:52:15 |只看作者 |坛友微信交流群
解释的很好!

使用道具

13
bianyue 发表于 2015-11-21 16:00:11 |只看作者 |坛友微信交流群
uuuuueeeee 发表于 2015-1-22 10:25
求问为什么有那个空格?另一题FA1就没有
结果里面是没有空格的,字符长度是25,因为first是16,substr截取了部分,但不能改变first的长度,这题和72题要一起看

使用道具

14
sophia1706 发表于 2017-7-19 13:46:39 |只看作者 |坛友微信交流群
fainy荧 发表于 2015-8-11 12:20
为什么照着代码打 运行后first的长度是15求大神解答
因为SAS 9.4之后scan function default length 定义变了,具体参照这里:
http://support.sas.com/documentation/cdl/en/lefunctionsref/69762/HTML/default/viewer.htm#p0jshdjy2z9zdzn1h7k90u99lyq6.htm
In a DATA step, if the SCAN function returns a value to a variable that has not yet been given a length, that variable is given the length of the first argument. This behavior is different from the behavior in previous releases of SAS. In previous releases, code that created a variable with a length of 200 might have produced a variable with a length that was greater than expected. If you need the SCAN function to assign a variable with a value that is different from the length of the first argument, use a LENGTH statement.

使用道具

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

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

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

GMT+8, 2024-5-2 20:58