%macro uconnect(rhtype,rhost=); %*--UMSL specific macro to facilitate making a remote connection. Typically will be invoked with a single positional parameter which specifies the remote-host type: unix, cms or win . If win is specified then user must code a %let mypc= prior to invoking. John Blodgett, UM St. Louis, 2.07.98--; %if &rhtype eq %str() %then %let rhtype=cms; %let rhtype=%lowcase(&rhtype); %if &rhtype eq jinx %then %let rhtype=unix; %if &rhtype eq umslvma or &rhtype=vm %then %let rhtype=cms; %if &rhtype eq mypc or &rhtype eq windows or &rhtype=win95 %then %let rhtype=win; %if &rhtype=unix or &rhtype=cms or &rhtype=win %then ; %else %do; %put; %put *******************************************************; %put *** Invalid value for rconnect remote host type parameter: ; %put *** Valid values are cms, unix or win .; %put *** rconnect will not be able to establish the connection.; %goto endmac; %end; %*--library where scripts are located vary from platform to platform. So we need to assign based on value of sysscp which lets us detect the platform in which this macro is being invoked.--; %local cp3_; %let cp3_=%substr(&sysscp,1,3); %if &cp3_=SUN or &cp3_=RS6 %then %do; %*--replace AIX with RS6, 2-24-98; filename rlink "!sasroot/misc/connect/tcp&rhtype..scr"; %end; %else %if &cp3_=WIN %then %do; %if &tcpsec eq %then %do; %put ***Note from unconnect: macro variable tcpsec must be defined prior ; %put * to invoking this macro to connect to your desktop. You need to code; %put * and submit a statement such as: ; %put * %bquote(%)let tcpsec=%str(;); %put ****** uconnect will abort without estalishing the connection *******; %put; %goto endmac; %end; %end; %else %if &cp3_=CMS %then %do; filename rlink "tcp&rhtype scr a"; %* following 5 lines only need to be run **once** ; filename mlib 'rlinkscr maclib c'; *--copy the maclib script to your sequential file version--; data _null_; infile mlib(tcp&rhtype); input; file rlink; put _infile_; run; %end; %else %do; %put *****Value of sysscp (&sysscp ) not recognized for this macro to; %put ***** find the appropriate script file. Sorry, cannot do it.***; %goto endmac; %end; %if &rhtype eq win %then %do; *--no script used--; filename rlink clear; %end; %global jinx cms njinx; %let jinx=jinx.umsl.edu; %let njinx=134.124.15.133; %let cms=umslvma.umsl.edu; options comamid=tcp; options nofmterr; *---allows remote datasets with permanent SAS format refs to be downloaded and accessed without errors --; %*--assign default value for rhost - remote host id--; %*--if user provides their own rhost value then they MUST predefine a macro variable with the IP address of the host. For example, if I invoke the macro with ..,rhost=oseda) then prior to invoking I need to code: %let oseda=oseda.missouri.edu ; %if %quote(&rhost) eq %str() %then %do; %if &rhtype=unix %then %let rhost=jinx; %if &rhtype=unix and &sysscp eq CMS %then %let jinx=&njinx; %if &rhtype=cms %then %let rhost=cms; %if &rhtype=win %then %let rhost=mypc; %end; options remote=&rhost; signon &rhost; %endmac: %mend uconnect;