Understanding DATA Step Processing |
Debugging a DATA
Step![]() ![]() |
Diagnosing Execution-time Errors
As you've seen, a DATA step that has syntax errors is compiled but not executed. Errors can also occur during the execution phase. When an execution-time error is detected, the following can occur, depending on the type of error
Assume you misspelled the fileref in the INFILE statement below. This is not a syntax error because SAS software does not validate the file you reference until the execution phase. During the compile phase, fileref Invnt is assumed to reference some external raw data file. data perm.update; infile invnt; input Item $ 1-13 IDnum $ 15-19 InStock 21-22 BackOrd 24-25; Total=instock+backord; run; So the error is not caught until the execution phase begins. Because there is no external file referenced by the fileref Invnt, the DATA step stops processing. |
SAS Log
07 data perm.update; 08 infile invnt; 09 input Item $ 1-13 IDnum $ 15-19 10 InStock 21-22 BackOrd 24-25; 11 Total=instock+backord; 12 run; ERROR: No logical assign for filename INVNT. NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set PERM.UPDATE may be incomplete. When this step was stopped there were 0 observations and 5 variables. |
Because Invent is misspelled, the statement in the DATA step that identifies the raw data is missing. Note, however, that the correct number of variables was defined in the descriptor portion of the data set. |
![]() ![]() ![]() ![]() ![]() ![]() |
|
![]() |
![]() |
Copyright © 2002 SAS Institute Inc.,
Cary, NC, USA. All rights reserved.