options symbolgen; title " Extended Mare-Winship Format for 19&SYSPARM "; * mwx.sas; * requires year argument: sas mwx -sysparm YY * Convert 1988 - 1993 March CPS to Mare-Winship format; * Program by Christine Carol. 1 April 1996 ; * missing: ; * x62 Normal Fulltime Job ; * x109 - x113 Type [A-E] income ; * Missing variables all zeroes ; options nocenter ps=79; filename raw pipe "zcat /home/data/cps/cpsmar&SYSPARM..raw.Z"; *filename out pipe "compress >../cpsmw&SYSPARM..raw.Z"; filename out pipe "compress >~/bulk/cpsmw&SYSPARM..raw.Z"; data; length cr $1;cr=byte(13); *infile raw lrecl=656; infile raw lrecl=1024; input rectype $1 @; retain x1-x129 0; retain x1 0; retain x2 0; retain x3 0; retain x10 0; retain year . ; retain msa ; retain msarank ; retain pmsarank ; retain cccode ; ; if rectype eq '1' then do; x1=x1+1; x2=0; x10=0; input @30 x5 1. @28 year 1. @29 x6 1. @40 x18 1. @58 x19 1. @278 x21 1. @278 x22 1. @23 x23 2. @21 x24 2. @39 x25 1. @57 x28 1. @40 x29 2. @40 x30 2. @248 x31 8. @287 x104 8. @44 msa 4. @50 msarank 3. @48 pmsarank 2. @285 cccode 1. ; end; if rectype eq '2' then do; x2=x2+1; x3=0; x10=x10+1; input @7 x12 2. @205 x16 8. @9 x17 1. @32 x92 5. @37 x93 1. @233 x103 8. @25 x122 1. @27 x123 1. @29 x125 1.; end; if rectype eq '3' then do; x3=x3+1; input @31 x14 1. @302 x32 1. @15 x33 2. @420 x34 1. @100 x35 1. @109 x36 1. @24 x37 1. @103 x38 3. @106 x39 3. @165 x40 1. @145 x41 1. @32 x44 1. @31 x45 1. @263 x46 5. @198 x47 1. @149 x48 1. @22 x49 2. @76 x50 2. @37 x51 2. @34 x52 1. @35 x53 2. @102 x54 1. @112 x55 1. @167 x56 1. @99 x57 1. @175 x58 1. @74 x59 1. @17 x60 1. @256 x61 6. @149 x63 1. @86 x64 1. @39 x65 1. @46 x66 2. @448 x67 8. @440 x68 8. @26 x69 1. @305 x70 5. @301 x71 1. @25 x72 1. @85 x73 1. @170 x74 1. @13 x75 2. @20 x76 1. @275 x78 1. @21 x79 1. @243 x80 6. @97 x81 2. @199 x83 1. @176 x84 2. @200 x85 1. @171 x86 2. @80 x88 2. @96 x89 1. @85 x90 1. @202 x94 1. @27 x95 2. @190 x96 3. @193 x98 3. @178 x99 1. @66 x107 8. @50 x108 8. @393 x114 5. @399 x115 5. @305 x116 5. @297 x117 4.; end; if year le 8 then x4 = year + 90; else x4 = year+80; /* Dec 96 by drf */ if x75 gt 9 then x75=0; /* single character output fields */ if x95 eq 10 then x95=0; file out lrecl=487; if rectype eq '3' then do; output; put x1 1-6 x2 7-9 x3 10-12 x4 13-14 x5 15 x6 16 x7 17-21 x8 22-24 x9 25-26 x10 27-32 x11 34 x12 35-36 x13 37 x14 39 x15 40-41 x16 42-51 x17 52 x18 53-54 x19 55 x20 56-61 x21 62 x22 63 x23 66-67 x24 68-69 x25 71 x26 72-73 x27 74-75 x28 77 x29 78-79 x30 80-81 x31 82-91 x32 92 x33 93-95 x34 96 x35 97 x36 98 x37 99 x38 100-102 x39 103-105 x40 106 x41 107 x42 108 x43 110 x44 112 x45 114 x46 115-121 x47 122 x48 123 x49 124-125 x50 126-127 x51 128-129 x52 131 x53 132-133 x54 134 x55 135 x56 136 x57 137 x58 138 x59 139 x60 140 x61 141-147 x62 148 x63 149 x64 150 x65 151 x66 152-153 x67 154-161 x68 162-169 x69 170 x70 171-177 x71 178 x72 179 x73 180 x74 181 x75 182 x76 183 x77 184 x78 185 x79 186 x80 187-193 x81 195-196 x82 197-198 x83 200 x84 201-202 x85 204 x86 205-206 x87 208 x88 209-210 x89 211 x90 212 x91 213-218 x92 219-224 x93 225 x94 226 x95 228 x96 229-231 x97 232 x98 233-235 x99 236 x100 237 x101 238-242 x102 243-247 x103 248-259 x104 260-270 x105 271-275 x106 276-280 x107 281-291 x108 292-303 x109 304-310 x110 311-317 x111 318-324 x112 325-331 x113 332-338 x114 339-345 x115 346-352 x116 353-359 x117 360-366 x118 367-370 x119 371-374 x120 375-376 x121 377-378 x122 379 x123 380 x124 381 x125 382 x126 383 x127 384 x128 385 x129 386 msa 387-390 msarank 391-393 pmsarank 394-395 cccode 396 cr 397 ; end; run; *proc freq ; *table x4; proc freq; table x39 x36; run;endsas;