If you omit the OUT= option, which specifies the name
of the output data set, from the DOWNLOAD statement, SAS follows
these rules to determine the name for the data set:
-
If the input data set (the data
set that is specified in the DATA= option) has a two-level name and
the same libref that is defined for the input data set is also defined
in the client environment, the data set is downloaded to the library
on the client that is associated with that libref. The data set has
the same member name on the client.
For example, suppose
you submit the following statement:
libname orders
client-SAS-library;
If you remotely submit
the following statements, the data set ORDERS.QTR1 is downloaded to
ORDERS.QTR1 on the client.
/*******************************************/
/* The libref ORDERS is defined on both */
/* the client and server. */
/*******************************************/
libname orders
server-SAS-library;
proc download data=orders.qtr1;
run;
-
If the input data set has a two-level
name but the libref for the input data set is not also defined in
the client environment, the data set is downloaded to the default
library on the client. This is usually the WORK library, but the library
might also be defined by using the USER libref.
The data set retains
the same data set name that it had on the server. For example, if
you remotely submit the following statements, the data set is downloaded
to WORK.QTR2 on the client.
/*******************************************/
/* The libref ORDERS is defined only on */
/* the server. */
/*******************************************/
libname orders
server-SAS-library;
proc download data=orders.qtr2;
run;
-
If the input data set has a one-level
name and the default libref on the server also exists on the client,
the data set is downloaded to that library.
For example, suppose
you submit the following statement:
libname orders
client-SAS-library;
libname local
client-SAS-library;
/************************************/
/* This option has no effect in */
/* this case. */
/************************************/
options user=local;
If you remotely submit
the following statements, the data set ORDERS.QTR1 is downloaded to
ORDERS.QTR1 on the client.
/*******************************************/
/* The libref ORDERS is defined on both */
/* hosts. */
/*******************************************/
libname orders
server-SAS-library;
options user=orders;
proc download data=qtr1;
run;
-
If the input data set has a one-level
name and the default libref on the server does not exist on the client,
the data set is downloaded to the default library on the client. That
is, the USER libref on the client is used only if the USER libref
on the server does not exist on the client.
For example, suppose
you submit these statements:
libname local
client-SAS-library;
options user=local;
When you remotely submit
the following statements, the data set ORDERS.QTR1 is downloaded to
LOCAL.QTR1 on the client.
/*******************************************/
/* The libref ORDERS is defined only on */
/* the servers. */
/*******************************************/
libname orders
server-SAS-library;
options user=orders;
proc download data=qtr1;
run;
-
If you omit the DATA= option, the
last data set that was created on the server during the SAS session
is downloaded to the client, as follows:
proc download;
run;
The naming conventions on the client follow one
of the previously described rules, based on how the last data set
was created.