由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - SAS BASE的一道题不明白,青椒
相关主题
SAS BASE 快疯掉了!!!!还问道SAS的题目
再问三个关于length的问题,谢谢百思不得其解的sas base 123题第76题
#SAS BASE 问题,明天就考试了##[求助]Base SAS123 几道题39,72,73,75,76,79,93
base 123题第72/73题求解:关于substr的返回长度one quick question about concatenating data in SAS
another sas question请问SPSS 或者 SAS中变量名的变换 AABB - BBAA
SAS base string question请教两道SAS变量长度的题目
a question about length assignment请教SAS 123题中的17, 57, 68, 72题
弱问:一道BASE题,怎么也不明白sas base 123 question 76 疑问
相关话题的讨论汇总
话题: england话题: city话题: length话题: sas话题: ipswich
进入Statistics版参与讨论
1 (共1页)
r******m
发帖数: 369
1
data work.test;
first = 'Ipswich,England';
City_country=substr(First,1,7)!!','!!'England';
run;
The length of City_country is
A 6
B 7
C 17
D 25
大案是D,不知道如何得到的?
P****D
发帖数: 11146
2
Typo. The length should be 23, just try it in SAS.
See last sentence -
http://support.sas.com/documentation/cdl/en/basess/58133/HTML/d
Understanding Concatenation of Variable Values
SAS enables you to combine character values into longer ones using an
operation known as concatenation. Concatenation combines character values by
placing them one after the other and assigning them to a variable. In SAS
programming, the concatenation operator is a pair of vertical bars (||). If
your keyboard does not have a solid vertical bar, use two broken vertical
bars (¦¦) or two exclamation points (!!). The length of the new
variable is the sum of the lengths of the pieces or number of characters
that is specified in a LENGTH statement for the new variable.
r******m
发帖数: 369
3
totally make sense, thanks!
P****D
发帖数: 11146
4
Give me Bao Zi, then!!!

【在 r******m 的大作中提到】
: totally make sense, thanks!
m*********n
发帖数: 119
5
data work.test;
first = 'Ipswich,England';
City_country=substr(First,1,7)!!','!!'England';
citylen=length(city_country);
run;
proc print data=test;
run;
------------
Obs first City_country citylen
1 Ipswich,England Ipswich,England 15
不明白为什么你们都说是23,不是15吗?

by
If
new

【在 P****D 的大作中提到】
: Typo. The length should be 23, just try it in SAS.
: See last sentence -
: http://support.sas.com/documentation/cdl/en/basess/58133/HTML/d
: Understanding Concatenation of Variable Values
: SAS enables you to combine character values into longer ones using an
: operation known as concatenation. Concatenation combines character values by
: placing them one after the other and assigning them to a variable. In SAS
: programming, the concatenation operator is a pair of vertical bars (||). If
: your keyboard does not have a solid vertical bar, use two broken vertical
: bars (¦¦) or two exclamation points (!!). The length of the new

q**********s
发帖数: 7
6
length( ) doesn't count trailing blanks.
if you change the length( ) with lengthc
******
a=lengthc(city_country);
put a;
******
results will be 23.
1 (共1页)
进入Statistics版参与讨论
相关主题
sas base 123 question 76 疑问another sas question
Another SAS perl questionSAS base string question
请问base(123题)的第16题a question about length assignment
a SAS question in base 70弱问:一道BASE题,怎么也不明白
SAS BASE 快疯掉了!!!!还问道SAS的题目
再问三个关于length的问题,谢谢百思不得其解的sas base 123题第76题
#SAS BASE 问题,明天就考试了##[求助]Base SAS123 几道题39,72,73,75,76,79,93
base 123题第72/73题求解:关于substr的返回长度one quick question about concatenating data in SAS
相关话题的讨论汇总
话题: england话题: city话题: length话题: sas话题: ipswich