[程式] sas去掉單位

看板Statistics作者 (麥豬不要跑)時間13年前 (2011/07/21 02:01), 編輯推噓3(302)
留言5則, 5人參與, 最新討論串1/1
[軟體程式類別]: sas [程式問題]: dada management [軟體熟悉度]: 低(1~3個月) [問題詳述] 我的data set如下 id unit 1 50ml 2 35ml 3 15ml 我想要變如下的樣子 id unit 1 50 2 35 3 15 就是把單位去掉就可以了 謝謝大家 ----------------------------------------------------------------------------- -- http://www.wretch.cc/album/maryastro -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 144.15.255.227

07/21 05:03, , 1F
如果數字的部分只有兩個 digit 用 substr 左邊取兩位就行了
07/21 05:03, 1F

07/21 06:59, , 2F
substr(unit,2,2)
07/21 06:59, 2F

07/21 10:15, , 3F
先確認所有資料的樣子,再選
07/21 10:15, 3F

07/21 17:24, , 4F
substr(unit, length(unit)-2)
07/21 17:24, 4F

07/23 00:53, , 5F
compress(unit,'','kd') 只保留數字部分
07/23 00:53, 5F
文章代碼(AID): #1E9nW99m (Statistics)