The PUTLOG statement writes a message that you specify to the SAS log.
The PUTLOG statement is helpful when you use macro-generated code because you can send output to the SAS log without affecting the current file destination.
The PUTLOG statement is similar to the ERROR statement except that PUTLOG does not set _ERROR_ to 1.
The PUT statement writes to the LOG or to an External File with a FILE statement, but the PUTLOG statement always writes to the LOG.
Try this example…
input Name $ 1-16 Score1 Score2 Score3; |
file "C:\oust.csv" lrecl=256 dlm= "," ; |
put (_all_) (:); /* The colon here is dummy and has no effect */ |
if last then putlog "NOTE: Writing to the File is completed" ; |
Here in the above example, When the FILE statement is in effect any PUT statement would write to the the external File….Then how would you write some informational messages to the LOG ?.
The PUTLOG statement can be used here to write to the LOG…You can precede your message text with WARNING, MESSAGE, or NOTE to better identify the output in the log…
References
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.