![]() Chapter Contents |
![]() Previous |
![]() Next |
SAS/CONNECT User's Guide |
Purpose |
Program |
This example signs on to two remote hosts, downloads data from both hosts, and performs analyses on the local host. The program uses the SIGNON and RSUBMIT statements. Therefore, it can be run from a line-mode session as well as from the windowing environment.
Note: Bullets through
apply to downloading both DB2 and ORACLE
data.
/*************************************/ /* establish link to OS/390 */ /*************************************/ [1] options comamid=ehllapi; filename rlink '!sasroot\connect\saslink\logtso.scr'; signon a; /*************************************/ /* download DB2 data using */ /* SAS/ACCESS view */ /*************************************/ [2] rsubmit a; [3] libname db 'app.db2.views' disp=shr; [4] proc download data=db.employee out=db2dat; run; [5] endrsubmit; /*************************************/ /* establish link to UNIX */ /*************************************/ [6] options remote=hrunix comamid=tcp; filename rlink '!sasroot\connect\saslink\tcpunix.scr'; signon; /*************************************/ /* download ORACLE data using */ /* SAS/ACCESS view */ /*************************************/ [2] rsubmit hrunix; [3] libname oracle '/hr/emp/records/'; [4] proc download data=oracle.employee out=oracdat; run; [5] endrsubmit; /*************************************/ /* sign off both links */ /*************************************/ [7] signoff hrunix; signoff a cscript= '!sasroot\connect\saslink\logtso.scr'; /*************************************/ /* join data into SAS view */ /*************************************/ [8] proc sql; create view joindat as select * from db2dat, oracdat where oracdat.emp=db2dat.emp; /*************************************/ /* create summary table */ /*************************************/ [9] proc tabulate data=joindat format=dollar14.2; class workdept sex; var salary; table workdept*(mean sum) all, salary*sex; title1 'Worldwide Inc. Salary Analysis by Departments'; title2 'Data Extracted from Corporate DB2 Database'; run; /* display graphics */ [10] proc gchart data=joindat; vbar workdept/type=sum sumvar=salary subgroup=sex ascending autoref width=6 ctext=cyan; pattern1 v=s c=cyan; pattern2 v=s c=magenta; format salary dollar14.; title1 h=5.5pct f=duplex c=white 'Worldwide Inc. Salary Analysis'; title2 h=4.75pct f=duplex c=white 'Data Extracted from Corporate DB2 Database'; run; quit;
![]()
When you have provided all of the necessary information, you can submit the SIGNON statement. You can specify the remote-session id in the SIGNON statement. If you omit the remote-session id from the RSUBMIT statement, the statements are submitted to the remote session that was identified most recently in a SIGNON statement, an RSUBMIT statement or command, or in a REMOTE= system option. | |
![]() | |
![]() | |
![]() | |
![]() | |
![]() | |
![]() | |
![]() | |
![]() | |
[10] If you have SAS/GRAPH on your local host, you can also use graphics procedures to analyze the view that is created from the two remote databases. |
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.