/* Richard A. DeVenezia * SUGI 29 - "Greetings from the Edge" * www.devenezia.com/papers */ * create a dummy buffer so that _infile_ can be * manipulated later; filename buffer catalog 'work.foo.bar.source'; data _null_; file buffer; put ' '; run; * use java to read data from remote archive * and process in data step using _infile_ buffer; data alarms (keep=when duration type); format when datetime16.; format time duration time8.; length type $10; length archive entryname $200; length line $256; archive = '\\extreme\papers\sugi-29\examples\alarms-2000.zip'; archive = 'http://www.devenezia.com/papers/sugi-29/examples/alarms-2000.zip'; * prep _infile_ buffer; infile buffer ; input @; declare javaobj jz ('ReadZippedFiles', archive); jz.callBooleanMethod ("getNextEntry", entryFound); do while (entryFound); jz.callStringMethod ("getEntryName", entryname); yearmo = substr(entryname,1,8); jz.callStringMethod ("readLine", line); jz.callBooleanMethod ("endOfEntry", eoe); do while (not eoe); * parse line of text with input statement; _infile_ = trim(yearmo) || line; input @1 date yymmdd10. time: time8. duration: time8. type: @ ; * put _infile_; when = dhms(date,0,0,0)+time; OUTPUT; jz.callStringMethod ("readLine", line); jz.callBooleanMethod ("endOfEntry", eoe); end; jz.callBooleanMethod ("getNextEntry", entryFound); end; jz.delete(); stop; run ; filename buffer; proc print data=alarms uniform; run;