Hello, The code below creates a different data set for each zipcode in my primary data set. However, it overwrites/deletes all of the datasets except for the one created during its last iteration. I would like for SAS to generate a unique data set for each different zipcode and save them all. Any thoughts??? data _null_; dcl hash hzipcode (ordered:'a'); hzipcode.definekey ('zipcode', 'state', 'city', 'year', 'observedclosings','quarter', 'finishedvacant','finishedsupply', 'housinginventory','housingsupply','vdlinventory','vdlsupply', 'underconstruction','Modelinventory','avgclosingprice','_n_'); hzipcode.definedata ('zipcode', 'state', 'city', 'year', 'observedclosings', 'quarter', finishedvacant','finishedsupply', 'housinginventoryy','housingsupply','vdlinventory', 'vdlsupply','underconstruction','Modelinventory', 'avgclosingprice'); hzipcode.definedone(); do _n_ = 1 by 1 until (last.zipcode); set SASUSER.Ivntrysort; by zipcode; hzipcode.add(); end; hzipcode.output (dataset: 'out' || put(zipcode, best.-L)); run; Mike
... View more