x cd /pub/data/stf903x/Tools; %let pgm=wcs_bystate_views; filename pgm "&pgm..sas"; options ls=112 nodate; /*---Define views in the wcs.bystate subdirectory. These views permit access via tel exchange to access data at the wire center level. jgb, 12-05-- */ libname stf903wc '/pub/data/stf903/wcs.bystate' ; libname stf93xwc '/pub/data/stf903x/wcs.bystate' ; %let stab=mo; *-------------------------(used to be) Step 9: --------------------------------------------------- Create the SAS views for both wc datasets (stf903 and stf903x) that will be accessible via the telex key. Requires creating indices on both of the wc datasets and the creation of an intermediate SAS set with all the areacode-dialing prefix combinations in sorted order. The views use that dataset as a base and then do keyed reads of the wc datasets to get the data for each telephone exchange.----------------; %macro doit(state,stab); *---here we create the telex view in the stf903 subdirectory---; data stf903wc.&stab.telex/view=stf903wc.&stab.telex; length areaname $40; set "/pub/data/stf903/wcs.bystate/&stab.acpfxs"; set "/pub/data/stf903/wcs.bystate/&stab.wcs" key=wirecent/unique; if _iorc_ then do; put /'***Error attempting to access data for WC ' wirecent " in stf903/wcs.bystate/&stab.wcs " _iorc_= _n_=; _error_=0; delete; end; run; *---...and here we create the telex view in the stf903x subdirectory---; data stf93xwc.&stab.telex/view=stf93xwc.&stab.telex; length areaname $40; set "/pub/data/stf903/wcs.bystate/&stab.acpfxs"; set "/pub/data/stf903x/wcs.bystate/&stab.wcs" key=wirecent/unique; if _iorc_ then do; put /'***Error attempting to access data for WC ' wirecent " in stf903x/wcs.bystate/&stab.wcs " _iorc_= _n_=; _error_=0; delete; end; run; data codes2&stab; set stf93xwc.&stab.telex(keep=wirecent areacode telex totpop poppsqmi medhhinc pctpoor ); format totpop comma9. poppsqmi comma6. medhhinc dollar7. pctpoor 5.1; run; proc print data=codes2&stab(obs=25); title2 "Listing of Some Codes for &statenm"; id telex; run; %mend doit; options NOmprint; %dostates(names=1,msgs=1);