s***r 发帖数: 1121 | 1 Varible
1234
123
567890
....
I want to remove the last digit; that is, 1234 -> 123; 123-> 12; 567890->
56789.
Anyone can help me? Thanks a lot.
One baozi will be given for your kind help. |
s*****b 发帖数: 106 | 2 If Char use, Substr from the 1 digit to (length-1)th digit,
If Numeric(and integer), use floor(X/10).
【在 s***r 的大作中提到】 : Varible : 1234 : 123 : 567890 : .... : I want to remove the last digit; that is, 1234 -> 123; 123-> 12; 567890-> : 56789. : Anyone can help me? Thanks a lot. : One baozi will be given for your kind help.
|
Y****a 发帖数: 243 | 3
是不是还要确定所有数值都靠左或靠右,然后再做适当处理
【在 s*****b 的大作中提到】 : If Char use, Substr from the 1 digit to (length-1)th digit, : If Numeric(and integer), use floor(X/10).
|
K*********r 发帖数: 299 | 4
compress了先
【在 Y****a 的大作中提到】 : : 是不是还要确定所有数值都靠左或靠右,然后再做适当处理
|
w********5 发帖数: 72 | 5 data file;
input num;
cards;
1234
123
567890
;
run;
data file1;
set file;
num_new=int(num/10);
run; |
i******r 发帖数: 323 | 6 if character values, you can try:
data test;
length x $50;
input x $;
cards;
1234
456
311
978
;
data t2;
set test;
x=substr(left(x), 1, length(x)-1);
run; |