/* Relate arcs to adjoining polygons &r addpolyrel gunit2 /* Relate unit code to Units table relate add un gunit.main info gunit.label.cd gunit.label.cd ordered RO ~ Tables sel gunit.main sort gunit.label.cd /*attribute fault segments with age of youngest adjoining unit dropitem gunit2.aat flt.seg.age /* so next line won't fail and crash macro additem gunit2.aat flt.seg.age 5 5 N 2 sel gunit2.aat calc flt.seg.age = rp//un//gunit.age.no resel lp//un//gunit.age.no < flt.seg.age calc flt.seg.age = lp//un//gunit.age.no quit relate add ftype gfault.lu info gfltseg.type.cd gfltseg.type.cd ordered RO ~ /* Save your relates relate save gunit2.rel &s trash = [delete max_age -INFO] &s trash = [delete min_age -INFO] /* Find minimum and maximum ages for all faults Tables sel gunit2.aat resel gfault.id > 0 resel ftype//explanation NC 'concealed' statistics gfault.id max_age minimum flt.seg.age END sel gunit2.aat resel gfault.id > 0 resel ftype//explanation CN 'concealed' statistics gfault.id min_age maximum flt.seg.age END sel max_age sort gfault.id resel min-flt.seg.age = 0.0 calc min-flt.seg.age = 99.0 sel min_age sort gfault.id quit /* Make a fault cover attributed with constraints on age of faulting &if [exist gfault2 -cover] &then kill gfault2 all dissolve gfault gfault2 gfault.id line relate add min min_age info gfault.id gfault.id ordered RO max max_age info gfault.id gfault.id ordered RO ~ /* Select Quaternary faults &if [exist qfaults -cover] &then kill qfaults all ae ec gfault2 ef arc sel max//min-flt.seg.age <= 6.0 /* cuts Pliocene strata resel min//max-flt.seg.age <= 5.0 /* overlapping strata are "Pleistocene to Miocene" or younger, /* i.e., not capped by Pliocene strata put qfaults quit /* Find distance from schools and hospitals to nearest Quaternary fault near schools qfaults line [calc 3280.8 * 20] near hospitals qfaults line [calc 3280.8 * 20] &return