x cd /pub/data/mable2k/Tools; %let pgm=tempcheck_02; filename pgm "&pgm..sas"; *--Check to see where we have unmatched county codes on the old and new mable datasets. John Blodgett, Sep, 2003. --*; options msglevel=i; ** fullstimer; %let mablepath=%str(/pub/data/mable2k); libname mable2k "&mablepath"; libname georef '/pub/data/georef' access=readonly; %macro checkem(stab,state); data _null_; merge mable2k.&stab.blks(in=inblks1) mable2k.&stab.blks2(in=inblks2 keep=county tract block ua ur ur90 puma5) mable2k.&stab.blks2a(in=inblks2a keep=county tract block ur00cor ua00cor ua90 ua90red ur90 ur90red cd108); by county tract block; if not (inblks1 and inblks2 and inblks2a) then do; if first.county then put "******Error: Missing a block obs: " county $5. +1 county $county. inblks1= inblks2= inblks2a=; end; if first.county then do; set mable2k.&stab.cocds1(rename=(county=countyck)); set mable2k.&stab.cocds2(rename=(county=countyck2)); put county= countyck= countyck2= inblks1= inblks2= inblks2a=; if county ne countyck then do; put "*************Error: county code on &stab.cocds1 dataset does not match that on the blks datasets****"; end; if county ne countyck2 then do; put "*************Error: county code on &stab.cocds2 dataset does not match that on the blks datasets****"; end; end; run; %mend checkem; options mprint; %checkem(va,51); %checkem(co,08);