* This check is not very straight forward and requires information from three segments; * since the variables in your files may be different, please check the merge syntax before running *First, in the offense segment, create a smaller file to ensure that the first offense matched to the property is a property offense recode off_code ('200' = 2) ('13A' = 1) ('13B' = 1) ('13C' = 1) ('510' = 2) ('220' = 2) ('250' = 2) ('290' = 2) ('35A' = 3) ('35B' = 3) ('270' = 2) ('210' = 2) ('26A' = 2) ('26B' = 2) ('26C' = 2) ('26D' = 2) ('26E' = 2) ('39A' = 3) ('39B' = 3) ('39C' = 3) ('39D' = 3) ('09A' = 1) ('09B' = 1) ('09C' = 1) ('100' = 1) ('23A' = 2) ('23B' = 2) ('23C' = 2) ('23D' = 2) ('23E' = 2) ('23F' = 2) ('23G' = 2) ('23H' = 2) ('240' = 2) ('370' = 3) ('40A' = 3) ('40B' = 3) ('120' = 2) ('11A' = 1) ('11B' = 1) ('11C' = 1) ('11D' = 1) ('36A' = 1) ('36B' = 1) ('280' = 2) ('520' = 3) into cri_typ. VARIABLE LABELS cri_typ 'Crime Type Categorization'. value labels cri_typ 1 'Crimes Against Persons' 2 'Crimes Against Property' 3 'Crimes Against Society'. USE ALL. SELECT IF(cri_typ = 2). EXECUTE . SORT CASES BY ori (A) inc_num (A) . SAVE OUTFILE='Directory:Path\Property Offenses.sav' /COMPRESSED. FILTER OFF. * Now match the property segment to the offense information get file = 'Directory:\Path\property segment.sav'. SORT CASES BY ori (A) inc_num (A) . COMPUTE master = 1 . EXECUTE . STRING id (A40). COMPUTE id = CONCAT(ori,inc_num) . EXECUTE . MATCH FILES /FILE=* /FILE='Directory:Path\Property Offenses.sav' /RENAME (assault auto autowpn1 autowpn2 autowpn3 bias crimact1 crimact2 crimact3 ibr_rec inc_date loc_cat meth_ent off_cat off_loc oth_sex prem_ent pt1vc st_code suspuse1 suspuse2 suspuse3 v_inj1 v_inj2 v_inj3 v_inj4 v_inj5 vic_num weapon1 weapon2 weapon3 wpn1 wpn1_cat wpn2 wpn2_cat wpn3 wpn3_cat wpn_cat wpn_cnt = 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 d26 d27 d28 d29 d30 d31 d32 d33 d34 d35 d36 d37 d38) /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 d26 d27 d28 d29 d30 d31 d32 d33 d34 d35 d36 d37 d38. EXECUTE. * Now match the property segment to the Admin segment to add the total number of offenses for each incident 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. * Now select property incidents other than arson and vandalism that include a structure in the property description USE ALL. COMPUTE filter_$=((off_code ~= '290' & off_code ~= '200') & (p_desc = '29' | p_desc = '30' | p_desc = '31' | p_desc = '32' | p_desc = '33' | p_desc = '34' | p_desc = '35')). VARIABLE LABEL filter_$ "off_code ~= '290' & (p_desc = '29' | p_desc = '30' |"+ " p_desc = '31' | p_desc = '32' | p_desc = '33' | p_desc ... (FILTER)". VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'. FORMAT filter_$ (f1.0). FILTER BY filter_$. EXECUTE . * And create the tables CROSSTABS /TABLES=off_code BY p_desc /FORMAT= AVALUE TABLES /CELLS= COUNT . CROSSTABS /TABLES=off_code BY tot_oseg /FORMAT= AVALUE TABLES /CELLS= COUNT .