Chapter Contents

Previous

Next
Moving and Accessing SAS Files across Operating Environments

Transporting SAS Files


Transporting Individual Data Sets

You use DATA= and OUT= options in PROC UPLOAD and PROC DOWNLOAD to transport data sets between hosts. The DATA= option identifies the source data set, and the OUT= option identifies the target name and destination.

This example shows how to copy the data set GRADES from the library SCHOOL on the local host to the temporary directory GRADES_COPY on the remote host.

proc upload data=school.grades out=grades_copy;
run;

You can use the WHERE statement to further subset the data based on the characteristics of the observations within the data set. The resulting data set that is transferred contains only those observations that satisfy the WHERE expression.


Transporting Members in a Data Library

You use the INLIB= and OUTLIB= options to PROC UPLOAD or PROC DOWNLOAD to transfer an entire library or selected members of a library. You use the MEMTYPE= option for specifying which member types to transfer. Valid values for the MEMTYPE= option are:

This example transports all data sets and catalogs in the library REMLIB on the remote host and stores them in the library LOCLIB on the local host:

proc download inlib=remlib outlib=loclib
   memtype=(data catalog);
run;

You can also use the SELECT or EXCLUDE statement to specify certain members within a library for transfer. Because the statements are mutually exclusive, they cannot be used together in the same procedure.


Transporting Catalog Entries

You use the INCAT= and OUTCAT= options in PROC UPLOAD or PROC DOWNLOAD to transfer a catalog. You can also use the SELECT or EXCLUDE statement to specify certain entries within the catalog or the ET= option to select a specific entry type within the catalog for transfer.

This example transfers all the SCL catalog entries from the catalog REMLIB.GENERAL-TOOLS on the remote host to the catalog LOCLIB.MY-TOOLS on the local host:

proc download incat=remlib.general-tools 
  outcat=loclib.my-tools
  et=scl;
run;

You can use SELECT statements to identify specific catalog entries for transfer. This example builds upon the preceding example.

proc download incat=remlib.general-tools
  outcat=loclib.my-tools
  select grades.format scores.infmt;
  select midterm final / et=scl;
run; 

The SELECT statements transferred these catalog entries:
GRADES of entry type FORMAT
SCORES of entry type INFMT
MIDTERM of entry type SCL
FINAL of entry type SCL.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.