Resources

SAS Studio: Help Center

What are code snippets?

Code snippets are lines of SAS code that you can use in an existing program or as the basis for a new program. Code snippets enable you to quickly insert SAS code into your program and customize it to meet your needs. SAS Studio is shipped with several code snippets. You can also create your own snippets and add snippets to your list of favorites.

For example, the Import XLSX File snippet includes the following code that you can add to your program and modify. The code imports data and then displays it from a Microsoft Excel file:

/** Import an XLSX file.  **/

PROC IMPORT DATAFILE="<Your XLSX File>"
	    OUT=WORK.MYEXCEL
	    DBMS=XLSX
	    REPLACE;
RUN;

/** Print the results. **/

PROC PRINT DATA=WORK.MYEXCEL; RUN;

For a list of snippets that are included with SAS Studio and for information about how to create your own snippets, see "Working with Code Snippets" in SAS Studio: User's Guide.