Hello, I have three variables below, a CASENUM variable a PHONETYPE variable which list 4 types of telephone "Cell" "Work" "Home" "Other" I want to create two other variables, a primary_phone_number which has all the phone numbers of CASENUM who choose a cell phone in the PHONETYPE variable and a second variable named secondary_phone_number which lists the cell phone numbers of everyone who did NOT LIST CELL PHONE in the PHONETYPE variable. The issue is that CASENUM does not identify everyone properly as their are duplicated CASENUMs
Code:
* Example generated by -dataex-. For more info, type help dataex clear input str12 CASENUM str10 PHONETYPE double PHONENUMBER "SAPD24118937" "Cell" 18304316624 "SAPD24118889" "Cell" 12109791643 "SAPD24118835" "Cell" 14024994996 "SAPD24118755" "Cell" 17856141487 "SAPD24118755" "Cell" 13038701951 "SAPD24118519" "Cell" 12106053538 "SAPD24118322" "Cell" 12106438156 "SAPD24117355" "Cell" 12109622257 "SAPD24117332" "Cell" 12107711890 "SAPD24117332" "Home" 17547799 "SAPD24117332" "Home" 12104452311 "SAPD24117313" "Cell" 15095928290 "SAPD24117309" "Cell" 12103866666 "SAPD24117283" "Home" 16263285 "SAPD24117283" "Cell" 12104541543 "SAPD24117155" "Cell" 12108105758 "SAPD24116684" "Cell" 12105178751 "SAPD24116652" "Cell" 15614258338 "SAPD24116633" "Cell" 12107179800 "SAPD24116556" "Cell" 17262067496 "SAPD24116238" "Work" 12106890915 "SAPD24116238" "Cell" 12107168732 "SAPD24116238" "Other" 12105733008 "SAPD24115375" "Cell" 12102871475 "SAPD24115319" "Other" 12104265972 "SAPD24115247" "Cell" 12108484932 "SAPD24114836" "Work" 12103662304 "SAPD24114836" "Home" 14796002 "SAPD24114836" "Other" 12102136075 "SAPD24114836" "Other" 12102136975 "SAPD24114824" "Home" 12102871383 "SAPD24114824" "Cell" 13614459044 "SAPD24114824" "Other" 18303050607 "SAPD24114770" "Other" 12103855645 "SAPD24114658" "Work" 12102062238 "SAPD24114658" "Cell" 12103780789 "SAPD24114544" "Cell" 17263339822 "SAPD24114368" "Cell" 14328160330 "SAPD24114255" "Cell" 12102515863 "SAPD24113868" "Cell" 13526344163 "SAPD24113859" "Cell" 19404358533 "SAPD24113829" "Work" 12104106553 "SAPD24113829" "Other" 18305708881 "SAPD24113799" "Cell" 14328894618 "SAPD24113799" "Cell" 14328892030 "SAPD24113439" "Cell" 12102547088 "SAPD24113306" "Cell" 12104730533 "SAPD24113212" "Cell" 12102907162 "SAPD24113212" "Cell" 12102942307 "SAPD24111630" "Cell" 17267770236 "SAPD24111630" "Cell" 12107945931 "SAPD24111630" "Work" 12105341874 "SAPD24111630" "Other" 12104655628 "SAPD24111551" "Cell" 12108129810 "SAPD24111414" "Cell" 18303189541 "SAPD24111414" "Other" 12107794694 "SAPD24111379" "Cell" 12103653666 "SAPD24110660" "Cell" 12108595319 "SAPD24110498" "Cell" 12105890399 "SAPD24110011" "Cell" 12103320671 "SAPD24109950" "Cell" 12104390646 "SAPD24109677" "Cell" 12108834344 "SAPD24108472" "Home" 19033609332 "SAPD24108472" "Cell" 12103800924 "SAPD24108472" "Cell" 12107276540 "SAPD24108372" "Cell" 12105961760 "SAPD24108372" "Cell" 12106678965 "SAPD24107440" "Cell" 14694505791 "SAPD24107432" "Cell" 12107392041 "SAPD24107418" "Other" 12105500267 "SAPD24107409" "Other" 12103223541 "SAPD24107346" "Cell" 12104520683 "SAPD24107346" "Cell" 12109191094 "SAPD24105046" "Cell" 19153282289 "SAPD24105046" "Cell" 12109311144 "SAPD24104764" "Cell" 12107241253 "SAPD24104764" "Cell" 12107106363 "SAPD24104764" "Home" 12109148740 "SAPD24103890" "Cell" 12106050037 "SAPD24103825" "Cell" 12108378937 "SAPD24103825" "Cell" 12109542626 "SAPD24103825" "Home" 15322286 "SAPD24103825" "Home" 12104091742 "SAPD24103326" "Cell" 12108151500 "SAPD24103232" "Other" 12109709964 "SAPD24103232" "Other" 12107822892 "SAPD24103232" "Other" 12106206927 "SAPD24103232" "Work" 12102231021 "SAPD24103232" "Cell" 12107402296 "SAPD24103232" "Home" 12107723527 "SAPD24103098" "Cell" 12107938622 "SAPD24103051" "Cell" 14322326766 "SAPD24103051" "Cell" 14323082799 "SAPD24102251" "Cell" 12106249294 "SAPD24102072" "Cell" 12109951656 "SAPD24101837" "Other" 18322479638 "SAPD24101837" "Cell" 18328183427 "SAPD24099793" "Cell" 18175426211 "SAPD24099751" "Cell" 12106939331 "SAPD24098514" "Cell" 13615826528 end
Comment