The code uses the automatic macro variable `&syslast` which references the last SAS table created or modified in the current session. The data therefore comes from the SAS session itself, not from an external source or created directly by this script.
1 Code Block
OPTION
Explanation : This SAS statement activates the `MCOMPILENOTE=ALL` system option. This configures SAS to issue a note in the log each time a macro is compiled, indicating the success of the compilation, the number of statements, and the size of the macro.
Copied!
options mcompilenote = all;
1
options mcompilenote = all;
2 Code Block
MACRO DEFINITION (%prtlast)
Explanation : This block defines a SAS macro named `prtlast`. When executed, this macro uses `PROC PRINT` to display the first ten observations (`obs=10`) of the last SAS table created or modified in the session (`&syslast`). A dynamic title is also applied to the listing, including the name of the table being processed.
Copied!
%macro prtlast;
proc print data=&syslast (obs=10);
title "Listing of &syslast data set";
run;
%mend;
1
%macro prtlast;
2
PROC PRINTDATA=&syslast (obs=10);
3
title "Listing of &syslast data set";
4
RUN;
5
%mend;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.