/* detect proper delim for UNIX vs. Windows */ %let delim=%sysfunc(ifc(%eval(&sysscp. = WIN),\,/)); /* create a name for our downloaded ZIP */ %let ziploc = %sysfunc(getoption(work))&delim.datafile.zip; filename download "&ziploc"; /* Download the ZIP file from the Internet*/ proc http method='GET' url="http://ai.fmcsa.dot.gov/ltccs/Data/TEXT/Public/LTCCS_db_txt_public_01.zip" out=download; run; /* Assign a fileref wth the ZIP method */ filename inzip zip "&ziploc"; /* Read the "members" (files) from the ZIP file */ data contents(keep=memname); length memname $200; fid=dopen("inzip"); if fid=0 then stop; memcount=dnum(fid); do i=1 to memcount; memname=dread(fid,i); output; end; rc=dclose(fid); run; /* create a report of the ZIP contents */ title "Files in the ZIP file"; proc print data=contents noobs N; run; /* Import a text file directly from the ZIP */ data hazmat; infile inzip(hazmat.txt) firstobs=2 dsd dlm='09'x; input CaseID $10. VehicleNumber Material Reportable Waiver PSU PSUStrata RATWeight; run; title "Box plot of Vehicles # per incident"; ods graphics / height=200 width=450; proc sgplot data=hazmat; hbox vehiclenumber; label VehicleNumber="# of vehicles"; xaxis labelattrs=(size=12) valueattrs=(size=12); run;