Running PROC COPY In-Database for Greenplum

Details about Running PROC COPY for Greenplum

Copying data in-database results in faster copy times because the data does not have to be loaded into or moved out of SAS. You can run the COPY procedure in-database to copy Greenplum data from one schema to another. The librefs for the IN= and OUT= options for PROC COPY must match for the SERVER=, PORT=, and DATABASE= values. The user who is specified for the IN= location must have Read permission for that location. The user who is specified for the OUT= location must have Read permission for the IN= location and Write permission for the OUT= location when data is copied in-database.

Note: Copying data in-database is also supported for the COPY operation in PROC DATASETS.

Here are some points to keep in mind when you copy data in-database:

To verify whether the COPY procedure ran in-database, specify MSGLEVEL=i in the OPTIONS statement.

See Also

PROC COPY Example

This example shows how to copy data in Greenplum between schemas in a database. This example copies the table My_table from schema Inschema into the schema Outsch. By specifying the REPLACE option in the OPTIONS statement, you ensure that you replace a data set if it already exists. The ACCEL option for the PROC COPY statement is enabled by default. This option controls whether data is copied in-database.

libname gpin greenplm user="myuser" database=userdb port=5432 
   server="gpserver.com" password=mypwd schema=inschema;
libname gpout greenplm user="myuser" database=userdb port=5432
   server="gpserver.com" password=mypwd schema=outsch;

options replace;

proc copy in=gpin out=gpout;
   select my_table;
run;
quit;

proc contents data=gpout.my_table; run;
Last updated: February 3, 2026