2015-02-04 10 views

Trả lời

15

Yes (trong 9.4 hoặc mới hơn):

option varinitchk = error;

Giá trị mặc định là note, giá trị có thể khác nonotewarning.

Ngoài ra còn có tính năng không có giấy tờ thay đổi các ghi chú nhất định thành lỗi. Bạn có thể đặt tùy chọn bằng cách sử dụng option dsoptions = note2err; hoặc bằng cách thêm / note2err vào một câu lệnh dữ liệu. Tôi tìm thấy một danh sách trên SAS-L của các ghi chú tùy chọn này thay đổi đến sai sót:

19 Variable %*v is uninitialized. 
97 Missing values were generated as a result of 
98 Division by zero detected at %2q. 
99 Mathematical operations could not be performed 
108 Invalid numeric data, '%*s' , at %2q. 
109 Invalid character data, %f , at %2q. 
110 Invalid %sargument to function %b at %2q. 
139 Argument to function %*s is not a known variable name: %*v. 
140 Argument to function %*s is not a valid variable name: %*s. 
205 Invalid argument(s) to the exponential operator "**" at %2q. 
208 Invalid numeric data, %*s='%*s' , at %2q. 
209 Invalid character data, %*s=%f , at %2q. 
223 A number has become too large at %2q. %w%*s 
224 A number has become too large during the compilation phase. 
225 Division by zero detected during the compilation phase. 
242 Invalid argument(s) to the exponential operator "**". 
258 Invalid argument to function %*b at %2q. 
259 Invalid first argument to function %*b at %2q. 
260 Invalid second argument to function %*b at %2q. 
261 Invalid third argument to function %*b at %2q. 
262 Invalid fourth argument to function %*b at %2q. 
267 Argument %d to function %*b at %2q is invalid. 
356 The SUBSTR pseudo-variable function does not allow character 
424 Character values have been converted to numeric 
425 Numeric values have been converted to character 
429 A number has become too large during the compilation phase, 
430 Division by zero detected during the compilation phase, 
484 Format %*b was not found or could not be loaded. 
485 Informat %*b was not found or could not be loaded. 

Source

+0

này là rất tốt ... quá xấu họ không mở rộng về vấn đề này để trang trải những thứ khác như kiểu tự động chuyển đổi. –

+4

Có thực sự là một tính năng không có giấy tờ thay đổi các ghi chú nhất định thành lỗi. Bạn có thể thiết lập tùy chọn bằng cách sử dụng 'tùy chọn dsoptions = note2err;' hoặc bằng cách thêm '/ note2err' vào một bước dữ liệu cụ thể. Điều này làm việc cho các biến chưa được khởi tạo và chuyển đổi loại tiềm ẩn. Tôi không biết những gì ghi chú khác nó có thể chuyển đổi. – DWal

+0

+1 trên dsoptions = note2err. Nó làm cho một LOT của ghi chú xấu trở thành lỗi. Hy vọng một ngày nào đó họ sẽ ghi lại nó để làm cho nó chính thức. – Quentin

Các vấn đề liên quan