LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (December 2004, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 7 Dec 2004 16:29:23 -0700
Reply-To:     Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Subject:      Re: how to access zipped file directly from the web ?
Comments: To: pchoate@DDS.CA.GOV
Content-Type: text/plain; charset=iso-8859-1

No documentation, read only.

-- JackHamilton@FirstHealth.com Manager, Technical Development Metrics Department, First Health West Sacramento, California USA

Coelum, non animum mutant, qui trans mare currunt.

>>> "Choate, Paul@DDS" <pchoate@DDS.CA.GOV> 12/07/2004 2:54 PM >>> Great tip Jack, thanks. The SASZIPAM engine allows member names:

427 filename in saszipam 'sample.zip'; 428 filename out 'test.txt'; 429 430 data _null_; 431 infile in(test.txt); 432 input; 433 file out; 434 put _infile_; 435 436 run;

NOTE: The infile library IN is: Stream=sample.zip

NOTE: The infile IN(test.txt) is: File Name=test.txt, Compressed Size=2387,Uncompressed Size=8175, Compression Level=-1,Clear Text=Yes

NOTE: The file OUT is: File Name=C:\Documents and Settings\pchoate\Desktop\test.txt, RECFM=V,LRECL=256

NOTE: A total of 345 records were read from the infile library IN. NOTE: 345 records were read from the infile IN(test.txt). NOTE: 345 records were written to the file OUT. The minimum record length was 0. The maximum record length was 129. NOTE: DATA statement used (Total process time): real time 0.06 seconds cpu time 0.01 seconds

I couldn't get it to create zip files though. I'd love to see documentation.

Paul Choate DDS Data Extraction (916) 654-2160

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Jack Hamilton Sent: Tuesday, December 07, 2004 2:26 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: how to access zipped file directly from the web ?

If the ZIP file were on a local drive, you could use the SASZIPAM access engine to read it. I don't think you can do so over the web.

You could copy the ZIP file to a local file and then use either the SASZIPAM engine or the PIPE engine to read the data. Buy you don't want to do that, so you might be out of luck. You could always write data step code to decompress the ZIP file; it should be possible, but I haven't heard of anyone doing so.

The UNZIP program lets you specify a member name, and I think that the SASZIPAM engine does also.

-- JackHamilton@FirstHealth.com Manager, Technical Development Metrics Department, First Health West Sacramento, California USA

Coelum, non animum mutant, qui trans mare currunt.

>>> "Piotr Wójcik" <pwojcik@WNE.UW.EDU.PL> 12/07/2004 1:26 PM >>> Hello everyone,

Is it possible to access a zipped txt file containing data directly from the web ? I know how to use an uncompressed file directly from the web:

filename dane url 'http://www.parkiet.com/dane/danesesji/bazytxt/akcje/zywiec.txt termstr=crlf;

That would be perfect if it were there as above, but unfortunately instead zywiec.txt I have zywiec.zip.

I do also know how to use a compressed file from a local drive:

filename zywiec pipe "c:\unzip -pa zywiec.zip";

data zywiec; infile zywiec dlm=";" firstobs=2; input ticker $ data $8. o $ h $ l $ c $ v; run;

But the file is refreshed every day (stock market quotations) and I don't want to download it every time to my hard drive. Therefore comes my question: is it somehow possible to unpack it on the fly and store the data to use in further computations without downloading it every time ?

The other question is: is it posibble to access a selected file from *.zip (if it contains more than one file) ?

I would be very grateful for any ideas :)

Best regards

Piotr

"MMS <firsthealth.com>" made the following annotations. ---------------------------------------------------------------------------- -- This message, including any attachments, is intended solely for the use of the named recipient(s) and may contain confidential and/or privileged information. Any unauthorized review, use, disclosure or distribution of this communication(s) is expressly prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy any and all copies of the original message. Thank you. =========================================================================== ==


Back to: Top of message | Previous page | Main SAS-L page