Copying Specific SAS Data Sets

Selecting Data Sets to Copy

To copy only a few data sets from a large SAS library, use the SELECT statement with the COPY statement. After the keyword SELECT, list the data set names with a blank space between the names, or use an abbreviated member list (such as YRDATA1-YRDATA5) if applicable.
For example, the following statements copy the data set HURRICANE from the library USCLIM to the library STORM. The input procedure library is PRECIP, so the COPY statement includes the IN= option in order to specify the USCLIM input library.
   copy in=usclim out=storm;
      select hurricane;
run;
The following SAS log shows that only the data set HURRICANE was copied to the library STORM:
Log 39.3 Copying the Data Set HURRICANE ...

Get Step-by-Step Programming with Base SAS 9.4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.