Chapter Contents |
Previous |
Next |
SAS/CONNECT User's Guide |
PROC DOWNLOAD
<data-set-option(s)>
|
CONSTRAINT=NO |
DATA=remote-SAS-data-set |
EXTENDSN=NO |
INDEX=NO |
OUT=local-SAS-data-set |
TRANIN= |
TRANNET= |
TRANOUT= |
V6TRANSPORT |
ENTRYTYPE=etype |
EXTENDSN=NO |
INCAT=remote-SAS-catalog |
OUTCAT=local-SAS-catalog |
CONSTRAINT=NO |
EXTENDSN=NO |
GEN=YES |
INDEX=NO |
INLIB=remote-SAS-library |
MEMTYPE=(mtype-list) |
OUTLIB=local-SAS-library |
V6TRANSPORT |
BINARY |
INFILE=remote-file-identifier |
OUTFILE=local-file-identifier |
PROC DOWNLOAD Statement Options |
The following options can be used with the PROC DOWNLOAD statement. They are shown in alphabetical order.
This option is valid for transferring data sets, catalogs, and libraries and results in data sets or catalog entries being transferred only if they have been modified on or after the specified date.
Note: This option is available in Releases 6.09E, 6.11,
TS040, and later.
For example, the following statements cause the transfer of data sets only if they have been modified on or after the specified date.
/************************************/ /* Download all data sets that have */ /* been modified in the last week. */ /************************************/ rsubmit; data _null_; today=date(); lastweek=today-7; call symput('lastweek',lastweek); run; proc download in=perm out=work after=&lastweek memtype=data; run; endrsubmit;
If your local session is using an earlier release that does not support this option, PROC DOWNLOAD still executes this option because the remote host has the input data set.
The BINARY option prevents record delimiters from being inserted at each host record. In addition, if the remote host uses a different method of data representation, the BINARY option prevents any data translation such as conversion from EBCDIC to ASCII. See The BINARY Option for more information.
Note: By default, integrity constraints
are re-created when you download a SAS library or when you download a single
SAS data set and omit the OUT= option. If you specify the OUT= option with
the DATA= option, the integrity constraints are not re-created.
If you specify the name of a data view in the DATA= option, the materialized data is downloaded to the local host, not to the view definition.
If you do not use the DATA=, INCAT=, or INFILE= option, the last SAS data set that was created on the remote host during your SAS session is downloaded.
If you use the DATA= option, you must either use the OUT= option or omit all other options.
Using the DATA= option, SAS/CONNECT supports the transfer of long named members for data set transfers, as long as the host supports long member names.
In Version 6 style translation, translation occurs twice for every transmission. The data is translated from local to transport format, and then the receiving host translates from transport format to local format. Two translations occur for all data that is transferred.
When both the local host and the remote host are Version 7 or Version 8, the translation rules have changed. First, no translation occurs if both the remote and local hosts have the same machine representations. This prevents any unnecessary translation from occurring. If translation is needed, the receiving host translates the data directly into its native representation. So, when both the local and remote hosts are running Version 7 or Version 8, the data is translated only one time when translation is necessary and is not translated when both hosts have the same machine architecture.
INCAT=libref._ALL_ |
If you specify this form for the INCAT= option, you must specify the same form for the OUTCAT= option.
You can transfer catalogs with entries that contain graphics output as well as other catalog entries.
Using the INCAT= option, SAS/CONNECT supports the transfer of long-named members for catalog transfers, as long as the host supports long member names.
The following examples illustrate some valid pairs of these options:
INLIB= OUTLIB= |
INLIB= OUT= |
IN= OUT= |
IN= OUTDD= |
INDD= OUTDD= |
INDD= OUTLIB= |
If you specify the OUT= option with the DATA= option, the index is not re-created. To create an index for the output data set, use the INDEX= data set option in the data set name that you specify in the OUT= option to define the index. The INDEX= data set option is described in SAS Language Reference: Dictionary.
You must define the fileref before specifying the PROC DOWNLOAD statement. Refer to the SAS documentation for your remote host for more information about this use of filerefs.
The following example demonstrates how to use a wildcard to transfer (download) all files that have the extension .sas and are located in a directory on the remote UNIX host to a folder on a local PC.
filename locref 'c:\'; rsubmit; filename fref '/local/programs'; proc download infile=fref('*.sas') outfile=locref; run; endrsubmit;
If you use the INFILE= option, you must also use the OUTFILE= option.
Using the OUT= option, SAS/CONNECT supports the transfer of long-named members for data set transfers, as long as the host supports long member names.
The OUT= option is a valid form of the OUTLIB= option. The DOWNLOAD procedure determines how to interpret the meaning of the OUT= option as follows:
For example, if the USER= option is set to MYLIB, the following statement downloads the data set A from the library MYLIB on the remote host to the library MYLIB on the local host:
proc download data=a out=a; run;
For example, the following statement downloads the last data set that was created on the remote host to the data set MYDATA in the library MYLIB on the local host (assuming USER=MYLIB).
proc download out=mydata; run;
proc download inlib=a out=rmtlib; run;
See Default Naming Conventions for Downloaded Data Sets for information about the effect of omitting the OUT= option.
OUTCAT=libref._ALL_ |
If you specify this form for the OUTCAT= option, you must specify the same form for the INCAT= option.
If you use the OUTCAT= option, you must also use the INCAT= option.
Using the OUTCAT= option, SAS/CONNECT supports the transfer of long-named members for catalog transfers, as long as the host supports long member names.
Note: If a wildcard (*) is used in the INFILE= option,
then OUTFILE=fileref should point to an aggregate storage location
such as a directory.
If you use the OUTFILE= option, you must also use the INFILE= option.
Note: The OUT= form of this option is the same as the
OUT= option that is used to specify a SAS data set. When you use this option,
the DOWNLOAD procedure determines whether the input option was DATA= or INLIB=
and processes the downloaded objects appropriately.
The OUTLIB= option must be used with the INLIB= option, but you can use any form of the OUTLIB= option with any form of the INLIB= option. Refer to the description of the INLIB= option for examples that illustrate some valid pairs of these options.
For example, FTP was used to transfer a data set from a UNIX machine to a remote VAX, and now you want to transfer the data set for use on your PC. The data set is not in the native VAX format (the remote host), so the default translation table will not work. Using the TRANIN= option with PROC DOWNLOAD, you can specify a translation table that transfers the data from UNIX to the PC.
The translation will take place on the remote host before the data is transferred to the local host. This option is equivalent to using the TRANTAB= data set option on the input data set.
Note: This option is only valid for data set transfers
between two Version 7 or Version 8 sessions and when the transfer is between
two hosts that have different machine architectures, which makes translation
necessary.
Note: This option is only valid for data set transfers
between two Version 7 or Version 8 sessions and when the transfer is between
two hosts that have different machine architectures, which makes translation
necessary.
For example, you are using a PC and would like to transfer a data set from a UNIX machine, and the OUTREP=VAX_VMS data set option is specified in a DATA statement. Using the TRANOUT= option with PROC DOWNLOAD, you can specify a translation table that transfers the data set from the remote UNIX machine to your local PC in a VAX format.
Note: This option is only valid for data set transfers
between two Version 7 or Version 8 sessions and when the transfer is between
two hosts that have different machine architectures, which makes translation
necessary.
When V6TRANSPORT is specified, the default behavior is to promote the length of numerics that are less than 8 bytes. The EXTENDSN=NO option may be used with the V6TRANSPORT option to prevent the lengths from being promoted.
When transferring files from Version 7 or Version 8 to Version 6, SAS/CONNECT checks that the files are Version 6 compliant. If the files are not Version 6 compliant, an error message is issued and the transfer is terminated. For example, a data set from a Version 7 or Version 8 session that contains a variable with a long name will not transfer because Version 6 does not support long variable names.
Data set and variable names are truncated if they exceed the Version 6 maximum. A warning message is issued about the truncation, but the transfer will continue.
In Version 6, the value of a character variable has a maximum length of 200. For Version 7 or Version 8, this maximum has been increased to 32K. Therefore, a Version 7 or Version 8 variable value that has a length that is greater than 200 will transfer to a Version 6 variable, but the value is truncated to 200. A warning message is issued about the truncation, but the transfer will continue.
Default Naming Conventions for Downloaded Data Sets |
For example, suppose you submit the following statement:
libname orders local-host-SAS-data-library;
If you remote submit the following statements, the data set ORDERS.QTR1 is downloaded to ORDERS.QTR1 on the local host.
/*******************************************/ /* The libref ORDERS is defined on both */ /* hosts. */ /*******************************************/ libname orders remote-host-SAS-data-library; proc download data=orders.qtr1; run;
The data set retains the same data set name that it had on the remote host. For example, if you remote submit the following statements, the data set is downloaded to WORK.QTR2 on the local host.
/*******************************************/ /* The libref ORDERS is defined only on */ /* the remote host. */ /*******************************************/ libname orders remote-host-SAS-data-library; proc download data=orders.qtr2; run;
For example, suppose you submit the following statement:
libname orders local-host-SAS-data-library; libname local local-host-SAS-data-library; /************************************/ /* This option has no effect in */ /* this case. */ /************************************/ options user=local;
If you remote submit the following statements, the data set ORDERS.QTR1 is downloaded to ORDERS.QTR1 on the local host.
/*******************************************/ /* The libref ORDERS is defined on both */ /* hosts. */ /*******************************************/ libname orders remote-host-SAS-data-library; options user=orders; proc download data=qtr1; run;
For example, suppose you submit these statements:
libname local local-host-SAS-data-library; options user=local;
When you remote submit the following statements, the data set ORDERS.QTR1 is downloaded to LOCAL.QTR1 on the local host.
/*******************************************/ /* The libref ORDERS is defined only on */ /* the remote hosts. */ /*******************************************/ libname orders remote-host-SAS-data-library; options user=orders; proc download data=qtr1; run;
proc download; run;the last data set that was created on the remote host during the SAS session is downloaded to the local host.
The naming conventions on the local host follow one of the rules described above, depending on how the last data set created was named.
Data Set Options and Attributes for the DOWNLOAD Statement |
In addition, when you download SAS data sets by using the DATA= option (omitting the OUT= option) or the INLIB= and OUTLIB= options, or if you omit all of these options, the following characteristics are inherited by the downloaded data set.
Note: The following list
of characteristics shows the SAS data set option (in parenthesis) that was
used to create the characteristic for the original data set. You do not have
to specify the option to have it inherited when the data set is downloaded.
Note: The index for a downloaded
SAS data set is re-created on the local host; it is not copied from the remote
host. To prevent the re-creation of the index, you can specify the INDEX=NO
option in the PROC DOWNLOAD statement, as described in PROC DOWNLOAD Statement Options.
If you specify the OUT= option when downloading a single data set, only the following characteristics are inherited by the downloaded data set:
The following example illustrates the use of the DATA= option and the INDEX=NO option. The example also shows the use of the KEEP= SAS data set option. Note that because no OUT= option is specified, the downloaded data set inherits the characteristics of the input data set except the index (because the INDEX=NO option is specified).
proc download data=study(keep=age score1 score2) index=no; run;
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.