Chapter Contents

Previous

Next
SAS/CONNECT User's Guide

Example 7. DTS: Transferring Data Set Integrity Constraints

PROC UPLOAD and PROC DOWNLOAD in SAS/CONNECT permit a transferred SAS data set to inherit the characteristics of the input data set. If the OUT= option is omitted when transferring a specific SAS data set, then the transferred data set inherits the characteristics of the input data set. A transferred data set also inherits the characteristics of the input data set if it is part of a library transfer (See the INLIB= and OUTLIB= options for PROC UPLOAD and PROC DOWNLOAD).

A new potential characteristic of a SAS data set known as integrity constraints has been added for SAS Version 7 or Version 8. Integrity constraints are a set of data validation rules that preserve the consistency and correctness of the stored data. These rules are defined by the applications programmer and are enforced by SAS for each request to modify the data.


Purpose

PROC UPLOAD and PROC DOWNLOAD have been modified for Version 7 or Version 8 to enable the transfer of integrity constraints that are defined on a data set. As with other data set characteristics, integrity constraints are inherited by a transferred data set under the conditions stated above. The only exception to this will be if the input file has an index defined and the user specifies the INDEX=NO option, then any integrity constraints that are defined for the input file will not be inherited. Also, referential integrity constraint types are never transferred.


Programs


Example 7.1: Omitting the OUT= Option from the PROC DOWNLOAD Statement

This example downloads the SAS data set REM in the library WORK on the remote host to the library WORK on the local host. Any non-referential integrity constraints defined for the input data set are inherited by the output data set.

proc download data=rem;


Example 7.2: Using the DROP= Option in the PROC UPLOAD Statement

This example uploads the SAS data set LOC in the library WORK on the local host to the library WORK on the remote host. The variable ONE is dropped from the output data set. Any non-referential integrity constraints that are defined for the input data set that do not include the variable ONE are inherited by the output data set.

proc upload data=loc(drop=one);


Example 7.3: Using the INLIB= Option in the PROC UPLOAD Statement

This example uploads all SAS data sets in the library SASUSER on the local host and stores them in the library WORK on the remote host. Any non-referential integrity constraints that are defined for each of the input data sets are inherited by the corresponding output data set.

proc upload inlib=sasuser outlib=work;


Example 7.4: Using the INDEX=NO Option in the PROC DOWNLOAD Statement

This example downloads the SAS data set STUDENTS in the library WORK on the remote host to the library WORK on the local host. Any non-referential integrity constraints defined for the input data set are inherited by the output data set unless there are indexes defined on the input data set, then no integrity constraints are defined for the output data set.

proc download data=students index=no;


Chapter Contents

Previous

Next

Top of Page

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