楼主: zhenghangbin
22808 14

[原创博文] 请问两个感叹号是什么含义? [推广有奖]

11
mengqinqing 发表于 2012-9-3 23:04:24
losttemple 发表于 2009-10-1 14:13
因为Phonenumber是数值变量
是不是所有数值变量在data步赋值时都自动是best12.的格式?
用自己的力量站在自己的位置

12
Bluewater1111 在职认证  发表于 2014-4-25 15:18:34
An automatic data conversion is performed whenever a numeric variable is used where
SAS expects a character value. The numeric variable is written with the BEST12. format
and the resulting character value is right-aligned when the conversion occurs. In this
example, the value of Phonenumberis converted to character and right-aligned before the
SUBSTR function is performed. Since there are only 10 digits in the value of
Phonenumber, the right-aligned value begins with two blanks. Therefore the SUBSTR
function picks up two blanks and a 3, and uses the BEST12. format to assign that value to
Code. Then, the parentheses are concatenated before and after the two blanks and a 3.

13
mibing 学生认证  发表于 2019-1-21 09:58:19
可是!!是什么意思啊?而且为什么()里只有3位?

14
小沐君 发表于 2019-1-21 19:28:53 来自手机
Bluewater1111 发表于 2014-4-25 15:18
An automatic data conversion is performed whenever a numeric variable is used where
SAS expects a  ...
多谢(o^^o)

15
凉风羽 发表于 2019-5-6 15:15:53
1 )双感叹号 !! 是字符串连接符, 和 ||  的作用是一样的.
   此处是把括号与substr计算的结果连接在一起
2) substr提取函数,只能从字符变量中提取,如果原来为数值变量,则调用该函数时自动将数值变量转为字符变量,不过按best12.格式转换.

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

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