Dear SAS Users, I have a large dataset for which I have to create a variable resident, that should be =1 if the individual's zipcode is equal to any one from the list below. I thought I would use the in:() statement but it doesn't seem to be working. Is there a better way to do this? data new; set old; input id zipcode; 1 3023 2 1071 3 3191 4 1081 ; resident=0 zipcode=in:('3197', '3197', '3198', '3198','3151','3191', '3191', '3192', '3193','3104', '3199', '3195', '3011', '3012', '3013', '3014', '3015', '3016', '3021', '3022', '3023', '3024', '3025', '3026', '3027', '3028', '3029', '3030', '3030', '3031', '3032', '3033', '3034', '3035', '3036', '3037', '3038', '3039', '3041', '3042', '3043', '3044', '3045', '3046', '3047', '3051', '3052', '3053', '3054', '3055', '3056', '3057', '3058', '3059', '3060', '3061', '3062', '3063', '3064', '3065', '3066', '3067', '3068', '3069', '3070', '3071', '3072', '3073', '3074', '3075', '3076', '3077', '3181', '3196'); if zipcode then resident=1; output; RUN;
... View more