rem calculate soctyp$ and related variables for standard sample basic use sccs4 let huntgath=v203+v204 let domsub$='OTH' if huntgath>=6 then let domsub$='1-HG' if v205>=6 then let domsub$='5-FI' if v206>=6 then let domsub$='6-HE' if v207>=6 then let domsub$='FA' if huntgath=5 and max(v205,v206,v207)<5 then let domsub$='1-HG' if v205=5 and max(huntgath,v206,v207)<5 then let domsub$='5-FI' if v206=5 and max(huntgath,v205,v207)<5 then let domsub$='6-HE' if v207=5 and max(huntgath,v205,v206)<5 then let domsub$='FA' if huntgath=4 and max(v205,v206,v207)<4 then let domsub$='1-HG' if v205=4 and max(huntgath,v206,v207)<4 then let domsub$='5-FI' if v206=4 and max(huntgath,v205,v207)<4 then let domsub$='6-HE' if v207=4 and max(huntgath,v205,v206)<4 then let domsub$='FA' if v203=. or v204=. or v205=. or v206=. or v207=. then let domsub$='' let soctyp$=domsub$ if v243=1 then let plow=0 else if inc(v243,2,3) then let plow=1 else let plow=. if v248=. and v254=. then let metals=. else if v248=9 and v254=9 then let metals=0 else let metals=1 rem farming & plow absent & metal working absent -> SH if domsub$='FA' then for if plow=0 then for if metals=0 then let soctyp$='2-SH' else if metals=1 then let soctyp$='3-AH' else let soctyp$='' next else if plow=1 then let soctyp$='4-AG' else let soctyp$='' next rem if HG and equine animals present -> OTH if domsub$='1-HG' and v244=4 then for let soctyp$='OTH' let domsub$='OTH' next if soctyp$='' then let othtyp=. else if soctyp$='OTH' then let othtyp=1 else let othtyp=0 if soctyp$='OTH' then let soctyp$='' let soctyp=cod(soctyp$,'1-HG','2-SH','3-AH','4-AG','5-FI','6-HE') let HG=0 if soctyp$='' then let HG=. if soctyp$='1-HG' then let HG=1 let SH=0 if soctyp$='' then let SH=. if soctyp$='2-SH' then let SH=1 let AH=0 if soctyp$='' then let AH=. if soctyp$='3-AH' then let AH=1 let AG=0 if soctyp$='' then let AG=. if soctyp$='4-AG' then let AG=1 let FI=0 if soctyp$='' then let FI=. if soctyp$='5-FI' then let FI=1 let HE=0 if soctyp$='' then let HE=. if soctyp$='6-HE' then let HE=1 save 'sccs5.syd' run use sccs5 xtab print none/freq tab soctyp$ soctyp domsub$ othtyp plow metals