error-handling - una - se utilizo la variable local sin inicializar c++
¿Puedo promocionar notas sobre variables no inicializadas a errores? (1)
Sí (en 9.4 o posterior):
option varinitchk = error;
El valor predeterminado es note
, otros valores posibles son nonote
y warning
.
También hay una función no documentada que cambia ciertas notas a errores. Puede establecer la opción usando la option dsoptions = note2err
; o agregando / note2err
a una declaración de datos. Encontré una lista en SAS-L de las notas; esta opción cambia a errores:
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.
Cuando SAS encuentra una variable no inicializada, generará una nota en el registro que se ve así:
NOTE: Variable not_in_data is uninitialized.
¿Es posible que SAS emita ese mensaje como una advertencia o un error?