DATA _NULL_ and PUT - printing output in log
Sometime in a code you don't want to create a dataset rather than want to see the output of something in log. In this tutorial we shall learn how to do it in SAS
To print the output in the log we will use two statements: DATA _NULL_ and PUT:
DATA _NULL_ : It does not create any SAS dataset
PUT : Does not open any output window rather, prints the result in the log.
Let us run the following SAS code. Here we have created a variable birthdt and have printed the statement Birthdate is 18Oct2007 in the log.
DATA _NULL_; FORMAT birthdt date9.; birthdt = '18Oct2007'd; PUT "Birthdate is: " birthdt; RUN;
Following is the screenshot of the log where our statement has been printed.