x cd /mscdc/data7/pl94test/Tools; %let pgm=genmddbs; filename pgm "&pgm..sas"; *--You can delete this line-; ******Note: we need to have the race categories as yes/no class vars but also as persons counts. Multiply the current race flags by persons and stored these in the view****; *--Follows the readupl_files setup. Here we generate some mddbs (MultiDimensionalDataBases). Requires having a SAS license for the mddb server product. John Blodgett, Missouri Census Data Center, Jan. 2000 (ongoing in 1st qtr, 2001) -- ; *--Assign processing parameters. Just ID the state with its postal abbrevation and fips code.--; *----To process a different state change all occurrences of "pl94.ca" to "pl94."--; %let stab=ca; title 'Generate Test MDDBs from test PL-94'; option ls=155 ps=59 nodate nocenter ; options msglevel=i fullstimer; *<---------------more info on log-----------------; libname pl94 '/mscdc/data7/pl94test'; *--This is the directory where the output data sets are saved--; **libname user '/tmp/storage/user8'; *---here we experiment with the new (for V8) "sasfile" statement which causes a SAS data set to be loaded into memory; sasfile pl94.race_ids load; *---------------Step 1: Create the "expanded detail" data set (view) at census block level only to be used as input to proc mddb. We use the geo_id and race_id keys to retrieve geocodes and race category details.-------------------------------------------*; data pl94.cablocks/view=pl94.cablocks; *--we only need detail data at the lowest block level. The mddb proc will rebuild the higher level summaries--; merge pl94.cadetail(in=indetail) pl94.cageos(in=ingeos keep=geo_id sumlev county tract bg block placefp pop100 where=(sumlev='750' and pop100>0)); by geo_id; if ingeos; drop sumlev pop100; _ptr=race_id+1; set pl94.race_ids point=_ptr; *--we pick up nraces, racelabl and white, ...., other-; length city $7; city=state||placefp; format city $fplace.; *--displays name of place but stores as code-; format county $county16. ; run; proc format; value nraces 1='1' 2-6='2+'; run; proc mddb data=pl94.cablocks(obs=max) out=pl94.pl94camddb1; *<----test run---; class county tract bg block city nraces voteage hispanic; ***class white black asian indian hawnpi other; format nraces nraces. ; var persons white--other/sum; hierarchy county tract bg /name=geo_ctg_totals display=yes totals=yes; hierarchy county city/name=geo_city_totals display=yes totals=yes; hierarchy county tract voteage hispanic nraces/name=tract_vh_nraces display=yes totals=yes; run; *--You can delete this line--;