*options obs = 10 ; 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 ; libname out "../" ; options nocenter ps=79; filename raw pipe "zcat /home/data/cps/cpsmar&SYSPARM..raw.Z"; data out.cpsmw&SYSPARM.; 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=387; if rectype eq '3' then do; output; end ; proc print data = out.cpsmw&sysparm. ( obs = 10 ); var msa: pmsa: cccode ;