Previous PageNext Page

Writing error messages to the SAS log
The PUT statement before the END statement writes text to the SAS log. For example, if TYPE is three the log will appear as follows:

45   DATA MIXED;
46      INPUT @20 TYPE 1. @;
47      SELECT (TYPE);
48         WHEN (1) INPUT ID     1-3
49                        AGE    4-5
50                        WEIGHT 6-8;
51         WHEN (2) INPUT ID    1-3
52                        AGE    10-11
53                        WEIGHT 15-17;
54         OTHERWISE PUT TYPE=;
55      END;
56   DATALINES;

TYPE=3


NOTE: The data set WORK.MIXED has 1 observations and 4 variables.

PUT statement (data step only)
The PUT statement syntax is the same as the INPUT statement. That is, you can use list-PUT, column-PUT or formatted-PUT. In addition, a form not covered so far is named-PUT.
PUT [pointer-control] variable-name [=] [format.];
The PUT statement writes the variable name, an equal sign, and the value of the variable.
Note: PUT statements use formats while INPUT statements use informats.

See SL:R, Chapter 9 SAS Language Statements: PUT list, PUT column, PUT formatted, and PUT named.

Previous PageTable Of ContentsNext Page