2013-10-30 36 views
0

如何將SAS中的指數(例如3.22254e2,3.24456545e-3)值轉換爲數字格式(322.254,0.00324456545)。我從文件中獲取varchar作爲源,並且需要將其作爲數字格式存儲在oracle中。SAS編程:將指數值轉換爲SAS中的數值

我需要從文件(csv)讀取所以當我試圖做同樣的我得到的結果(b)爲空。

我的代碼:

data work.exp_num ; 
infile 'exp_number.csv' 
     lrecl = 256 
     delimiter = '~' 
     dsd 
     missover 
     firstobs = 2; 
; 
attrib a length = $300 
    format = $32. 
    informat = $32.; 
input a ; 
run; 

data test; 
set work.exp_num; 
b=input(a,32.16); 
run; 

請幫助。

在此先感謝。

回答

0

您可以使用標準信息w.d。
這裏有一個例子:

data test; 
    a='3.24456545e-3'; output; 
    a='3.22254e2'; output; 
run; 

data erg; 
    set test; 
    b=input(a,32.16); 
run;