Previous Page | Next Page

The UPLOAD Procedure

PROC UPLOAD Statement


Transfers files from the client to the server.
Valid in: client session
Category: Data Access


Syntax

PROC UPLOAD
<data-set-option(s)>
<catalog-option(s)>
<library-option(s)>
<external-file-option(s)>
<AFTER=date>
<CONNECTSTATUS=YES | NO>;

Syntax Description


PROC UPLOAD Statement Options

AFTER=date

specifies a modification date in the form of a numeric date value or a SAS date constant.

This option is valid for transferring data sets, catalogs, and libraries. Its use results in data sets or catalog entries being transferred only if they have been modified on or after the specified date.

The AFTER= option is also valid for external file transfers between most computers. If a computer is unable to perform the transfer, this message is displayed:

ERROR: AFTER= not supported on this platform. 
NOTE: The SAS System stopped processing this step
      because of errors.

Note:   The AFTER= option is available in SAS 6.09E, SAS 6.11 TS040, and later.  [cautionend]

For example, the following statement causes the transfer of any data sets or catalog entries in the library ACCTS only if they have been modified on or after December 30, 2001.

proc upload inlib=accts outlib=accts 
   after='30dec01'd status=no;

If your client session is using an earlier release of SAS that does not support this option, PROC UPLOAD produces the following message:

Warning: AFTER= option not supported by earlier
         release; option will be ignored.

Note:   If the client is running SAS 6.11 TS020 or SAS 6.08 TS415 through SAS 6.08 TS430, the option is ignored, but no warning is displayed.  [cautionend]

BINARY

specifies an upload of a binary image (an exact copy) of an external client file. Use this option only for uploading external files.

Note:   External files are files that are not SAS files.  [cautionend]

By default, if the client and server run in different operating environments (for example, UNIX and Windows), PROC UPLOAD transfers a file from the client to the server, translating the file from UNIX representation to Windows representation. Furthermore, PROC UPLOAD inserts record delimiters that are appropriate for the target environment.

You do not always want to translate a file. For example, you might need to upload executable files from the client to the server and later download them to the same or a different client. Binary file format also conserves resources for users who store their own files and for system backups. The BINARY option prevents delimiters from being inserted for each file record that is created at the server. In addition, if the client and server use a different method of data representation, the BINARY option prevents any data translation between ASCII and EBCDIC.

For an example of using the BINARY option, see Example 10. DTS: Distributing an .EXE File from the Server to Multiple Clients.

CONNECTSTATUS=YES | NO

specifies whether the Transfer Status window should be displayed during a transfer. By default, the UPLOAD procedure displays the Transfer Status Window (CONNECTSTATUS=YES)

Alias: CSTATUS=, STATUS=
Default: YES
CONSTRAINT=YES | NO

specifies if integrity constraints should be re-created on the server when a SAS data set that has integrity constraints defined is uploaded. You can specify this option with the DATA= option (if you omit the OUT= option) or with the INLIB= and OUTLIB= options.

By default, integrity constraints are re-created only when you upload a SAS library or when you upload 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.

DATA=client-SAS-data-set <(SAS-data-set-option(s))>

specifies a SAS data set to upload from the client to the server. If the data set is a permanent SAS data set, you must define a libref before the PROC UPLOAD statement and specify the two-level name of the data set.

If you specify the name of a data view in the DATA= option, the materialized data is uploaded to the server, not to the view definition.

If you do not specify the DATA=, INCAT=, INLIB=, or INFILE= option, the last SAS data set that was created on the client during your SAS session is uploaded.

Requirements: When you specify the DATA= option, you must either specify the OUT= option or omit all other output file options.
Interaction: The data set is characterized by SAS data set options that were specified when the data set was created. For example, specifying the COMPRESS=YES data set option would cause all observations in the data set to be compressed. You use SAS data set options to change the data set's characteristics or to apply new characteristics.
Featured In: Specifying Data Set Options for the DATA= and OUT= Options in PROC UPLOAD and PROC DOWNLOAD
See: SAS data set options in SAS Language Reference: Dictionary
See Also: OUT= option
DATECOPY

retains the date on which a SAS data set was created and the date on which a SAS data set was last modified for each data set that is transferred.

ENTRYTYPE=etype

specifies a catalog entry type to be uploaded. Examples of catalog entry types include DATA and FORMAT.

Alias: ETYPE=, ET=
Requirements: To use this option, you must also specify the INCAT= and OUTCAT= options.
EXTENDSN=YES | NO

specifies whether to promote the length of short numerics (length less than 8 bytes) when transferring.

NO

indicates that the length of numeric variables is not promoted.

YES

indicates that 1 will be added to the length of any numeric variable that has a length of less than 8 bytes before it is transferred to the server.

The behavior of the EXTENDSN= option varies according to the SAS release that is used.

  • If both the client and the server run SAS 8 or a later release, and the V6TRANSPORT option is specified, the default is to promote the length of a numeric variable whose length is less than 8 bytes. This is consistent with SAS 6 behavior. To override this behavior, specify EXTENDSN=NO along with the V6TRANSPORT option in the UPLOAD statement.

  • If either the client or the server runs SAS 6, neither the V6TRANSPORT nor the EXTENDSN= option is supported or recognized.

  • If the client runs SAS 6 and the server runs SAS 8 or a later release, a numeric variable whose length is less than 8 bytes is promoted , by default. In this case, specify EXTENDSN=NO in order to override the SAS 6 default and to prevent the promotion.

See File Format Translation Algorithms for information about translating file formats between a client and server that run on computers whose internal representations are incompatible.

Default: NO
GEN=YES | NO

specifies that data set generations are to be sent during library transfers.

YES

specifies that data set generations are sent during library transfers.

NO

specifies that data set generations are not sent during library transfers.

Default: YES
INCAT=client-SAS-catalog

names a SAS catalog that you want to upload from the client to the server. If the catalog is stored in a permanent SAS library, you must define a libref before specifying the PROC UPLOAD statement, and you must specify the catalog's two-level name.

To upload all of the catalogs in a SAS library, specify 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.

CAUTION:
Some catalog entry types are not compatible between SAS releases.

If you attempt to upload a catalog entry from a client to a server and they run different SAS releases, the client catalog entry that is being uploaded might not be supported at the server. In this case, the catalog entry will not be transferred and the following error message is displayed:

WARNING: FILEFMT entries
  [cautionend]
INDEX=YES | NO

specifies whether to re-create an index when you upload a SAS data set to the server session. Otherwise, an existing index that is associated with the data set being uploaded can be copied to the server session. The INDEX= option in the DATA step is used to create an index file that can be copied to the server session. For details about the INDEX= option in the DATA step, see SAS Language Reference: Dictionary.

The INDEX= option in PROC UPLOAD is relevant under any of these conditions:

  • if you use the DATA= option in the PROC UPLOAD statement

  • if you use the INLIB= and OUTLIB= options in PROC UPLOAD

  • if you omit the OUT= option in PROC UPLOAD

By default, an index will be re-created in the server session under these conditions:

  • if you do not specify the INDEX= option, you upload a single data set, and you omit the OUT= option in PROC UPLOAD

  • if you do not specify the INDEX= option, and you upload an entire SAS library

By default, an index will not be re-created in the server session when all of these conditions are met:

  • if you do not specify the INDEX= option

  • if you omit the DATA= option in the PROC UPLOAD statement

  • if you omit the OUT= option in PROC UPLOAD

For conceptual information about indexing, see SAS Language Reference: Concepts.

If you choose to re-create an index for the data set being uploaded, you must specify one or more variables to be indexed. For an example, see Example 13. Re-creating an Index for a Data Transfer.

INFILE=client-file-identifier

specifies the external file that you want to upload to the server from the client.

If you use the INFILE= option, you must also use the OUTFILE= option.

client-file-identifier can be one of the following:

fileref

is used if you have defined a fileref on the client that is associated with a single file. You must define the fileref before specifying the PROC UPLOAD statement.

fileref(member)

is used if you have defined a fileref on the client that is associated with an aggregate storage location, such as a directory. member specifies one or more files in that aggregate storage location that should be transferred. An asterisk (*) can be used as a wildcard character in the member specification of the files to transfer. Here are the only valid uses of the asterisk wildcard character:

  • to specify all files in the specified location (*)

  • to specify all files that have the same extension (*.extension)

  • to specify all files that have the same name but different extensions (name.*)

You must define the fileref before specifying the PROC UPLOAD statement. For details about filerefs, see the documentation that is appropriate for your operating environment.

This example shows how to use a wildcard to transfer all files whose filenames have the extension .sas and are located in a directory on a server that runs UNIX to a folder on a client that runs Windows.

filename locref 'c:\';
rsubmit;
   filename fref '/local/programs';
   proc upload infile=locref('*.sas') 
               outfile=fref;
   run;
endrsubmit;
'external-file-name'

is used to explicitly define the file that is to be uploaded.

INLIB=client-SAS-library

specifies a SAS library to upload from the client to the server. This option must be used with the OUTLIB= option. Before using this option, you must define the libref that is used for client-SAS-library.

Alias: IN=, INDD=
MEMTYPE=(mtype-list)

specifies one or more member types to be uploaded.

Here are the valid member types:

  • ALL

  • CATALOG

  • DATA

  • MDDB

  • VIEW

Alias: MTYPE=, MT=
Requirements: To use this option, you must also specify the INLIB= and OUTLIB= options.
OUTLIB=server-SAS-data-set <(SAS-data-set-option(s))>
OUT=

specifies the SAS data set in the server session that you want the uploaded data set written to. If you want to create a permanent SAS data set, you must define the libref before specifying the PROC UPLOAD statement, and you must specify a two-level SAS data set name.

The transfer of a long name that might be assigned to a data set is restricted by the SAS release that you are using. SAS releases after SAS 6 support long names assigned to a data set. If a data set that has a long name is transferred to a server that runs SAS 6 or earlier, the long name is truncated. For details about long names, see SAS Language Reference: Concepts.

The OUT= option is a valid form of the OUTLIB= option. The UPLOAD procedure determines the meaning of the OUT= option as follows:

  • If you specify the DATA= option and the OUT= option, the OUT= option names the output SAS data set.

    For example, if the USER= option is set to MYLIB, the following statement uploads the data set A from the library MYLIB on the client to the library MYLIB on the server:

    proc upload data=a out=a;
    run;
  • If you specify only the OUTLIB= option, the UPLOAD procedure uploads the last SAS data set that was created on the client.

    For example, the following statement uploads the last data set that was created on the client to the data set MYDATA in the library MYLIB on the server (assuming USER=MYLIB).

    proc upload out=mydata;
    run;
  • If you specify the INLIB= option and the OUTLIB= option, the OUTLIB= option specifies the name of a SAS library.

    For example, the following statement uploads all of the data sets and catalogs that are in the library A on the client to the library RMTLIB on the server.

    proc upload inlib=a outlib=rmtlib;
    run;

For details about the effect of omitting the OUTLIB= option, see Default Naming Conventions for Uploaded Data Sets.

Interaction: Most SAS data set options that were used to characterize the data set when it was created will not be inherited when the OUT= option is used. Only the LABEL= and TYPE= data set options are inherited. However, you can explicitly specify SAS data set options as arguments to the OUT= option when uploading a data set. For example, specifying the COMPRESS=YES data set option would cause all observations in the data set to be compressed. You use SAS data set options to change the data set's characteristics or to apply new characteristics.
Featured In: Specifying Data Set Options for the DATA= and OUT= Options in PROC UPLOAD and PROC DOWNLOAD
See: SAS data set options in SAS Language Reference: Dictionary
See Also: DATA= option
OUTCAT=server-SAS-catalog

names the SAS catalog that you want to upload to. If you want to create a permanent SAS catalog, you must define the libref before specifying the PROC UPLOAD statement, and you must specify a two-level SAS catalog name. To upload all of the catalogs in a SAS library, specify OUTCAT=libref._ALL_.

Requirements: If you use the OUTCAT= option, you must also use the INCAT= option. If you specify the _ALL_ option in OUTCAT=, you must also specify _ALL_ in the INCAT= option.
Tip: If you transfer a catalog that contains entries of type PROGRAM, you must compile the entries on the target operating environment before execution. To compile all the PROGRAM entries in a catalog, submit (or remotely submit) the following statements:
proc build cat=libref.member-name batch;
   compile;
run;
libref identifies the SAS library that contains the catalog, and member-name identifies the catalog.
OUTFILE=server-file-identifier

specifies an external file in the server session to which the file in the client session will be transferred.

Here are the values for server-file-identifier:

"external-filename"

is the physical location of the file in the server session to which the file in the client session is transferred.

Note:   Enclose the filename in double or single quotation marks.  [cautionend]

fileref

is the SAS file name that is associated with the physical location of a single file in the server session.

Note:   You must define the fileref before you can specify it in the PROC UPLOAD statement.  [cautionend]

fileref(member)

is the fileref that is associated with an aggregate storage location, such as a directory or a partitioned data set, in the server session. member specifies the file in the aggregate storage location that will be transferred.

Note:   You must define the fileref before you can specify it in the PROC UPLOAD statement. For details about filerefs for your operating environment, see the appropriate operating environment companion documentation.   [cautionend]

Note:   If a wildcard (*) is used in the INFILE= option, then OUTFILE=fileref should point to an aggregate storage location such as a directory.  [cautionend]

Requirements: If you use the OUTFILE= option, you must also use the INFILE= option.
OUTLIB=server-SAS-library

names the destination SAS library on your server where the uploaded data sets and catalogs from the client are stored. Before using this option, you must define the libref that is used for server-SAS-library.

Note:   The OUTLIB= form of this option is the same as the OUT= option that is used to specify a SAS data set. When you use the OUTLIB= option, the UPLOAD procedure determines whether the input option was DATA= or INLIB= and processes the uploaded objects appropriately.  [cautionend]

Alias: OUTDD=, OUT=
VIEWTODATA

for a library transfer only, causes view descriptor files to be transferred as data sets instead of as view files, which is the default. If you want some views to be transferred as view files and other views to be transferred as data sets, you would have to perform two separate transfers. If you attempt to use this option for a single data set transfer (by using the DATA= option), an error results.

V6TRANSPORT

specifies that data should be translated by using the SAS 6 data translation algorithm. Specify this option only when you want to use the SAS 6 translation style explicitly and both the client and the server run SAS 8 or a later release.

When V6TRANSPORT is specified, the default behavior is to promote a numeric variable whose length is less than 8 bytes. To prevent a promotion of this length, you can use the EXTENDSN=NO option along with the V6TRANSPORT option.


Default Naming Conventions for Uploaded Data Sets

If you omit the OUT= option, which specifies the name of the output data set, from the UPLOAD statement, SAS follows these rules to determine the name for the data set:


Specifying Data Set Options for the DATA= and OUT= Options in PROC UPLOAD and PROC DOWNLOAD


Restrictions on Using Data Set Options

You can specify SAS data set options only in the DATA= and OUT= options of the PROC UPLOAD statement.

You cannot specify SAS data set options in the INLIB= and OUTLIB= options, even when uploading a single data set. A data set option must be associated with a specific SAS data set.

An uploaded SAS data set inherits characteristics from the selected SAS data set options that are listed in this table under any of these conditions:

Default SAS Data Set Options for Data Set Uploads
SAS Data Set Option Definition Inherited When PROC UPLOAD DATA= Is Used Inherited When PROC UPLOAD OUT= Is Used
ALTER= Specifies a password for ALTER protection. Yes No
COMPRESS Specifies whether to compress observations, or specifies the compression method. Yes No
GENMAX= Specifies the maximum number of generations. Yes No
INDEX= Specifies whether to index a data set.

The index for an uploaded SAS data set is re-created on the server, not copied from the client. To prevent the re-creation of the index, you can specify the INDEX=NO option in the PROC UPLOAD statement, as described in PROC UPLOAD Statement Options.

Yes No
LABEL= Specifies whether to label a data set. Yes Yes
READ= Specifies a password for read protection. Yes No
REUSE= Specifies whether to reuse free space in compressed data sets. Yes No
SORTEDBY= Specifies the variables by which the data set is sorted. Yes No
TYPE= Specifies the data set type. Yes Yes
WRITE= Specifies the password for WRITE protection. Yes No


Example 1: KEEP= Option

In this example, the KEEP= SAS data set option is used as an argument to the DATA= option in PROC UPLOAD. Because the OUT= option is omitted, the uploaded data set inherits the characteristics of the input data set, including a default action to re-create the index. For details about the KEEP= data set option and a complete list of SAS data set options, see SAS Language Reference: Dictionary.

proc upload data=study(keep=age score1 score2);
run;


Example 2: OUT= Option

In this example, because the OUT= option is specified, the uploaded data set does not inherit the characteristics of the input data set study. Instead, the data set is renamed as results in the server session. The uploaded data set also inherits only the LABEL= and TYPE= data set options. For details about the LABEL= and TYPE= SAS data set options, see SAS Language Reference: Dictionary.

proc upload data=study  out=results;
run;


Example 3: KEEP= and OUT= Options

In this example, the KEEP= SAS data set option is used as an argument to the OUT= option in PROC UPLOAD. Because the OUT= option is specified, the uploaded data set does not inherit the characteristics of the input data set study. Instead, the data set is renamed as results in the server session. The uploaded data set also inherits only the LABEL= and TYPE= data set options. The INDEX=NO data set option specifies that the index will not be re-created in the server session.

For details about the LABEL=, TYPE=, and KEEP= SAS system options, see SAS Language Reference: Dictionary.

proc upload data=study  out=results(keep=age score1 score2) index=no;
run;

Previous Page | Next Page | Top of Page