[prev in list] [next in list] [prev in thread] [next in thread]
List: sas-l
Subject: Re: Accessing SAS data on remote FTP server
From: Don Stanley <dstanle () IBM ! NET>
Date: 1996-06-29 21:13:24
[Download RAW message or body]
Roger Deangelis wrote:
>
> I needed to store SAS data on a remote FTP server (SUN 1000E Solaris 2.5)
> that did not have SAS. In addition I needed to access that data within
> my SAS session on my Local machine ( eventually a Win95 telnet SAS session).
>
> The following worked for me.
>
> %macro utlftpr
> / des = "Build and access SAS remote data";
>
> /*----------------------------------------------*\
> | |
> | Store your SAS data on any remote FTP |
> | server (do not need SAS on remote server) |
> | then access the data from your local |
> | session |
> | |
> | This little 'object' |
> | |
> | 1. 'Alloc' SAS 'table' on a remote host |
> | (SAS table is in sequential Xport |
> | format need filename - libname ) |
> | |
> | 2. Create a local table 'test' |
> | |
> | 3. Populate remote 'table' using local |
> | table (Proc copy 'table' test ) |
> | |
> | 4. Sum column on remote table |
> | (last datstep) |
> | Summing remote data |
> | |
> | Do not need SAS on remote host |
> | Do need ftp |
> | |
> \*----------------------------------------------*/
>
> /*----------------------------------------------*\
> | Define Seq Xport Library on Remote Host |
> | Need libname and filename |
> \*----------------------------------------------*/
>
> filename inp ftp '/xxxxxxx/yyyyyy/zzz/utl01in1.cpo' user='zzzzzzz'
> pass="xxxxxxx" host='ggggggg' rcmd='site blocksize=8000 recfm=fb
> lrecl=80';
>
> libname inp xport;
>
> /*----------------------------------------------*\
> | Arbitrary test table |
> \*----------------------------------------------*/
>
> data test;
> do i=1 to 100;
> x=i*i;
> output;
> end;
> run;
>
> /*----------------------------------------------*\
> | Copy test table to remote host |
> \*----------------------------------------------*/
>
> proc copy in=work out=inp mt=data;
> select test;
> run;
>
> /*----------------------------------------------*\
> | This is the interesting part |
> | |
> | Access remote 'table' as though it was local |
> | |
> \*----------------------------------------------*/
>
> data _null_;
>
> set inp.test end = done; /* access remote table */
>
> sum+i;
>
> if done then put sum=;
>
> run;
>
> %mend utlftpr;
>
> %utlftpr;
>
> Roger DeAngelis
Great stuff
this answers the track I've had open with SAS for three weeks now that no-one
seems to
know the answer to!
Thanks
Don
==========================+++++==========================================
Don Stanley
Don Stanley Consulting Services
NEW ZEALAND DSTANLE@IBM.NET
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic