* First we have to prepare the property segment to be matched to the admin segment SORT CASES BY ori (A) inc_num (A) . COMPUTE master = 1 . EXECUTE . STRING id (A40). COMPUTE id = CONCAT(ori,inc_num) . EXECUTE . * Then the files are matched MATCH FILES /FILE=* /FILE='Directory:Path\Administrative Segment.sav' /RENAME (city_sub exclr_dy exclr_mo exclr_yr excp_clr ibr_rec inc_date inc_dy inc_hr inc_mo inc_yr incoff1 incoff10 incoff2 incoff3 incoff4 incoff5 incoff6 incoff7 incoff8 incoff9 rptdate st_code tot_aseg tot_dseg tot_vseg = d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 d21 d22 d23 d24 d25) /BY ori inc_num /DROP= d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 d21 d22 d23 d24 d25. EXECUTE. USE ALL. SELECT IF(master = 1). EXECUTE . DO REPEAT x=id TO tot_oseg. IF (id=Lag(id)) x=LAG(x). END IF. EXECUTE. END REPEAT. EXECUTE. * A table is produced to show the loss type associated with each offense; the second table shows how many offenses are associated with each incident CROSSTABS /TABLES=off_code BY losstype /FORMAT= AVALUE TABLES /CELLS= COUNT . CROSSTABS /TABLES=off_code BY tot_oseg /FORMAT= AVALUE TABLES /CELLS= COUNT .