我可以通过substring 来实现,但是问题是这个变量以s开头的何以x开头的字节长度不同,请问怎么能够解决呢?谢谢作者: shiyiming 时间: 2006-5-24 22:19 标题: RE id=compress(id,1234567890)||substr(id,2,length(id)-2);
or
id=compress(id,1234567890)||compress(id,compress(id,1234567890));作者: shiyiming 时间: 2006-5-25 17:55 标题: 有问题 这个方法可以顺利转换
s23445a
s24563b
s21342g
但是
x3456872a
x4532233h
就能变成
x3456872
x4532233
不知道怎么回事,谢谢作者: shiyiming 时间: 2006-5-26 03:28 标题: RE They should be the same, no matter the'x' or 's' which is at first position.
Please post your code you used.作者: shiyiming 时间: 2006-5-28 11:14 标题: 是字节长度的问题 code 用的是你写的,直接粘贴的。
我试了,是字节长度的问题,如果x3456872a 和x4532233h 中间少一
个数字,就可以顺利转换成xa345687和xh453223。compress的命令对字节长度有要求么?谢谢作者: shiyiming 时间: 2006-5-30 22:01 标题: RE 字节长度 should be no more than 262 characters.作者: shiyiming 时间: 2006-5-31 17:04 标题: 默认长度是8 data temp;
length id $20;
input id$;
cards;
s23445a
s24563b
s21342g
s34212w
x3456872a
x4532233h
;run;
data temp2;
set temp;
xx=compress(id,1234567890)||compress(id,compress(id,1234567890));
run;
This is OK!作者: shiyiming 时间: 2006-6-1 11:54 标题: Thanks Thank you very much