
/****************************************************************/
/* SAS SAMPLE LIBRARY */
/* */
/* NAME: RLNKDMO */
/* TITLE: DEMO OF SAS/CONNECT FEATURES */
/* PRODUCT: SAS/CONNECT */
/* SYSTEM: ALL */
/* KEYS: CONNECT GSLIDE */
/* PROCS: DOWNLOAD UPLOAD */
/* DATA: */
/* */
/* REF: */
/* MISC: 1. This sample will demonstrate how to transfer */
/* all of the following SAS files: SAS datasets, */
/* SAS/AF catalogs, SAS/GRAPH catalogs and output, */
/* and text or binary files. */
/* 2. Any statement containing host-dependent data */
/* is "commented out." Please make any needed */
/* corrections and remove the asterisk (*) before */
/* using this sample. */
/* 3. Any external file references MUST be modified */
/* prior to running this file. (The filename */
/* examples below use the FILENAME.EXT convention.)*/
/* 4. The Graphics examples require the use of a */
/* valid graphics device driver. This sample uses */
/* DEVICE=CGA. */
/****************************************************************/
/*********************************/
/* User must supply conversation */
/* parameters. */
/*********************************/
* options remote=session_id;
* options comamid=comm_access_method;
* filename rlink 'connect_script_file';
signon;
/****************************************************************/
/* UPLOAD and DOWNLOAD of SAS datasets */
/****************************************************************/
data pc_up;
retain c 'PC string';
do i=1 to 10;
j=sqrt(i);
output;
end;
run;
rsubmit;
proc upload data=pc_up out=host_up;
run;
data host_dn;
retain c 'Host string';
do i=1 to 10;
j=sqrt(i);
output;
end;
run;
proc download data=host_dn out=pc_dn;
run;
endrsubmit;
/*******************************************************************/
/* Transfer of SAS catalogs */
/*******************************************************************/
proc format lib=work.pccat;
value xyz 1='Connect Test';
run;
rsubmit;
proc upload incat=pccat outcat=hostcat;
run;
proc download incat=hostcat outcat=loc_cat;
run;
endrsubmit;
/****************************************************************/
/* UPLOAD and DOWNLOAD of text or binary files */
/****************************************************************/
/*********************************/
/* The following filename should */
/* be changed if you are not */
/* using a directory-based */
/* operating system. */
/*********************************/
* filename local 'connect.tmp';
data _null_;
file local;
put 'abcdefg';
run;
rsubmit;
/*********************************/
/* The following filename should */
/* be changed if you are not */
/* using a directory-based */
/* operating system. */
/*********************************/
* filename remote 'connect2.tmp';
/* TEXT file upload */
proc upload infile=local outfile=remote;
run;
/* BINARY file upload */
proc upload infile=local outfile=remote binary;
run;
/* TEXT file download */
proc download infile=remote outfile=local;
run;
/* BINARY file download */
proc download infile=remote outfile=local binary;
run;
endrsubmit;
/****************************************************************/
/* DOWNLOAD of host-generated graphics catalog */
/* NOTE: modify the following DEVICE= option if it is not */
/* appropriate for your local computer. */
/****************************************************************/
* goptions device=cga;
goptions nodisplay;
rsubmit;
goptions device=grlink;
proc gslide border ;
note 'This is the CONNECT sample program RLNKDMO';
run;
/* The graphics catalog will be transferred to the WORK.GSEG */
/* graphics catalog on the local host. You may use PROC */
/* GREPLAY to view the graph. */
endrsubmit;
/****************************************************************/
/* Display of host-generated graphics. */
/* NOTE: modify the following DEVICE= option if it is not */
/* appropriate for your local computer. */
/****************************************************************/
* goptions device=cga;
goptions display;
rsubmit;
proc gtestit pic=1; run;
endrsubmit;
/****************************************************************/
/* Signing off the remote host . */
/****************************************************************/
signoff;
|