2013-01-25 36 views
0
data _null_; 
    put "hello world"; 
run; 

將打印hello world到控制檯。如何使用數字輸入?

data _null_; 
put 1; 
run; 

給我

Encountered " "put" "put "" at line 2, column 1. 
Was expecting one of: 
<EOF> 
";" ... 
"*" ... 
"data" ... 
"proc" ... 
(and 41 more)" 

回答

4
data _null_; 
put "1"; 
run; 

你把文本控制檯。因此,實際上,「1」和1是相同的。你不能把未格式化的數字,只格式化(即文本)。即使把一個數值型變量將工作方式:

data _null_; 
x=1; 
put x; 
run; 

這其實是把與BEST1.格式(如果你選擇,你可以重寫格式)格式的數字1。

相關問題