Chapter Contents

Previous

Next
SAS/CONNECT User's Guide

Example 10. DTS: Distributing an .EXE File from the Remote Host to Multiple Local Hosts


Purpose

Access to remote host files by means of SAS/CONNECT makes it easy to distribute information to large numbers of local host users. Rather than distributing files on diskettes, one central file on the remote host can be copied by each local host by using SAS/CONNECT.

For example, suppose you update an executable on your PC and would like to distribute the update to other PCs in your organization. You decide that the most efficient way to update all PCs is to upload PROGRAM.EXE to the remote host, and notify each person who uses this software on their workstations that the file is available and should be downloaded. This method allows all users on the local host quick access to the updated software and eliminates passing a diskette from user to user.

Note:   A SAS/CONNECT application like this one, in which an external nontext file is uploaded and then downloaded, requires the BINARY option. The BINARY option is used in the DOWNLOAD and UPLOAD procedures. The BINARY option transfers files without any character conversion (for example EBCDIC to ASCII) or insertion of record delimiters.  [cautionend]


Programs


Example 10.1: UPLOAD

The PROGRAM.DLL module must first be uploaded to an external file on the remote host. You start SAS/CONNECT and remote submit these statements:

rsubmit;
   filename rfile 'remote-host-file';
   proc upload infile='a:\program.dll'
      outfile=rfile binary;
   run;
endrsubmit;

This example uses a SAS FILENAME statement to identify the target file on the remote host.

Notice that the INFILE= and OUTFILE= options are used in the PROC UPLOAD statement rather than the DATA= and OUT= options. This is because the file that is being uploaded is an external file, not a SAS data set.

Execute the PROC UPLOAD program by using an RSUBMIT command. As the program executes, messages are displayed in the LOG window tracking the procedure's status. The ENDRSUBMIT command is used to terminate the remote submit.


Example 10.2: DOWNLOAD

With the PROGRAM.DLL module available on the remote host, each user on the local host at the installation can acquire the update module by downloading it from the remote host.

The process for downloading the PROGRAM.DLL module is like the process for uploading except that you invoke the DOWNLOAD procedure, and the target file is on the remote host, not the local host. For example, to copy the PROGRAM.DLL module to your directory \SAS\SASEXE, use:

rsubmit;
   filename rfile 'remote-host-file';
   proc download infile=rfile
      outfile='\sas\sasexe\program.dll' binary;
   run;
endrsubmit;

This example uses a SAS FILENAME statement to identify the target file on the remote host.

The INFILE= and OUTFILE= options are used in the PROC DOWNLOAD statement.

Execute the PROC DOWNLOAD step with the RSUBMIT command. As the file downloads, messages that track the status of the transfer are displayed in the LOG window. The ENDRSUBMIT command is used to terminate the remote submit.


Chapter Contents

Previous

Next

Top of Page

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