As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.


Here are some tips for How to share your SAS knowledge with your professional network.


Tips:Create a PROC IMPORT or PROC EXPORT Template Program for Ease of Use

From sasCommunity
Jump to: navigation, search

You don't have to memorize the exact syntax and all of the options of PROC EXPORT or PROC IMPORT, or go fumbling for the documentation every time you need to use them. Instead, create a PROC EXPORT template and a PROC IMPORT template for yourself using the wizards in SAS Display Manager. Then, copy and modify either template in your programs to suit your particular needs.

In SAS Display Manager, select: <File>, then <Export Data>. Choose the SASHELP.CLASS SAS data set just to have something to work with. Then, go through all of the subsequent windows, choosing all of the available options. When you get to the window that states:

The EXPORT wizard can create a file containing PROC EXPORT commands that can be used in SAS programs to export this data again. If you want these statements to be generated, enter the filename where they should be saved.

...simply choose a directory and then a meaningful program name, such as "Export to Excel Template.sas". When you click <Finish>, you will have a SAS program that looks something like this:

PROC EXPORT DATA= SASHELP.CLASS
            OUTFILE= "C:\Documents and Settings\RAITHEL_M\SAS Class.XLS" 
            DBMS=EXCEL LABEL REPLACE;
     RANGE="SAS Class"; 
     NEWFILE=YES;
RUN;

You can reverse this process with the Import Data wizard to create a PROC IMPORT template.

Submitted by Michael A. Raithel, The man who wrote the book on performance.. Contact me at my Discussion Page.