1 The SAS System 16:40 Monday, June 6, 2005 NOTE: Copyright (c) 1999-2001 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) Proprietary Software Release 8.2 (TS2M0) Licensed to HARVARD SCHOOL OF PUBLIC HEALTH-INSTRUCTIONAL COMP, Site 0001177014. NOTE: This session is executing on the SunOS 5.9 platform. This message is contained in the SAS news file, and is presented upon initialization. Edit the files "news" in the "misc/base" directory to display site-specific news and information in the program log. The command line option "-nonews" will prevent this display. ---------------------------------------------------------- NOTE: SAS initialization used: real time 0.44 seconds cpu time 0.08 seconds 1 2 options symbolgen; SYMBOLGEN: Macro variable SYSPARM resolves to 88 3 title " Extended Mare-Winship Format for 19&SYSPARM "; 4 * mwx.sas; 5 * requires year argument: sas mwx -sysparm YY 6 * Convert 1988 - 1993 March CPS to Mare-Winship format; 7 * Program by Christine Carol. 1 April 1996 ; 8 * missing: ; 9 * x62 Normal Fulltime Job ; 10 * x109 - x113 Type [A-E] income ; 11 * Missing variables all zeroes ; 12 13 options nocenter ps=79; 14 filename raw SYMBOLGEN: Macro variable SYSPARM resolves to 88 14 ! pipe "zcat /home/data/cps/cpsmar&SYSPARM..raw.Z"; 15 *filename out pipe "compress >../cpsmw&SYSPARM..raw.Z"; 16 filename out SYMBOLGEN: Macro variable SYSPARM resolves to 88 16 ! pipe "compress >~/bulk/cpsmw&SYSPARM..raw.Z"; 17 data; 18 length cr $1;cr=byte(13); 19 *infile raw lrecl=656; 20 infile raw lrecl=1024; 21 input rectype $1 @; 22 retain x1-x129 0; 23 retain x1 0; 24 retain x2 0; 25 retain x3 0; 26 retain x10 0; 27 retain year . ; 28 retain msa ; 29 retain msarank ; 30 retain pmsarank ; 31 retain cccode ; 32 ; 33 34 if rectype eq '1' then do; 35 36 x1=x1+1; x2=0; x10=0; 37 38 input 39 40 @30 x5 1. 41 @28 year 1. 42 @29 x6 1. 43 @40 x18 1. 44 @58 x19 1. 45 @278 x21 1. 46 @278 x22 1. 47 @23 x23 2. 48 @21 x24 2. 49 @39 x25 1. 50 @57 x28 1. 51 @40 x29 2. 52 @40 x30 2. 2 The SAS System 16:40 Monday, June 6, 2005 53 @248 x31 8. 54 @287 x104 8. 55 @44 msa 4. 56 @50 msarank 3. 57 @48 pmsarank 2. 58 @285 cccode 1. 59 ; 60 end; 61 62 if rectype eq '2' then do; 63 64 x2=x2+1; x3=0; 65 x10=x10+1; 66 67 input 68 69 @7 x12 2. 70 @205 x16 8. 71 @9 x17 1. 72 @32 x92 5. 73 @37 x93 1. 74 @233 x103 8. 75 @25 x122 1. 76 @27 x123 1. 77 @29 x125 1.; 78 end; 79 80 if rectype eq '3' then do; 81 82 x3=x3+1; 83 84 input 85 86 @31 x14 1. 87 @302 x32 1. 88 @15 x33 2. 89 @420 x34 1. 90 @100 x35 1. 91 @109 x36 1. 92 @24 x37 1. 93 @103 x38 3. 94 @106 x39 3. 95 @165 x40 1. 96 @145 x41 1. 97 @32 x44 1. 98 @31 x45 1. 99 @263 x46 5. 100 @198 x47 1. 101 @149 x48 1. 102 @22 x49 2. 103 @76 x50 2. 104 @37 x51 2. 105 @34 x52 1. 106 @35 x53 2. 107 @102 x54 1. 108 @112 x55 1. 109 @167 x56 1. 110 @99 x57 1. 111 @175 x58 1. 112 @74 x59 1. 113 @17 x60 1. 114 @256 x61 6. 115 @149 x63 1. 116 @86 x64 1. 117 @39 x65 1. 118 @46 x66 2. 119 @448 x67 8. 120 @440 x68 8. 121 @26 x69 1. 122 @305 x70 5. 123 @301 x71 1. 124 @25 x72 1. 125 @85 x73 1. 126 @170 x74 1. 127 @13 x75 2. 128 @20 x76 1. 129 @275 x78 1. 3 The SAS System 16:40 Monday, June 6, 2005 130 @21 x79 1. 131 @243 x80 6. 132 @97 x81 2. 133 @199 x83 1. 134 @176 x84 2. 135 @200 x85 1. 136 @171 x86 2. 137 @80 x88 2. 138 @96 x89 1. 139 @85 x90 1. 140 @202 x94 1. 141 @27 x95 2. 142 @190 x96 3. 143 @193 x98 3. 144 @178 x99 1. 145 @66 x107 8. 146 @50 x108 8. 147 @393 x114 5. 148 @399 x115 5. 149 @305 x116 5. 150 @297 x117 4.; 151 end; 152 if year le 8 then x4 = year + 90; else x4 = year+80; /* Dec 96 by drf */ 153 if x75 gt 9 then x75=0; /* single character output fields */ 154 if x95 eq 10 then x95=0; 155 156 file out lrecl=487; 157 if rectype eq '3' then do; output; put 158 x1 1-6 x2 7-9 x3 10-12 x4 13-14 x5 15 159 x6 16 x7 17-21 x8 22-24 x9 25-26 x10 27-32 160 x11 34 x12 35-36 x13 37 x14 39 x15 40-41 161 x16 42-51 x17 52 x18 53-54 x19 55 x20 56-61 162 x21 62 x22 63 x23 66-67 x24 68-69 x25 71 163 x26 72-73 x27 74-75 x28 77 x29 78-79 x30 80-81 164 x31 82-91 x32 92 x33 93-95 x34 96 x35 97 165 x36 98 x37 99 x38 100-102 x39 103-105 x40 106 166 x41 107 x42 108 x43 110 x44 112 x45 114 167 x46 115-121 x47 122 x48 123 x49 124-125 x50 126-127 168 x51 128-129 x52 131 x53 132-133 x54 134 x55 135 169 x56 136 x57 137 x58 138 x59 139 x60 140 170 x61 141-147 x62 148 x63 149 x64 150 x65 151 171 x66 152-153 x67 154-161 x68 162-169 x69 170 x70 171-177 172 x71 178 x72 179 x73 180 x74 181 x75 182 173 x76 183 x77 184 x78 185 x79 186 x80 187-193 174 x81 195-196 x82 197-198 x83 200 x84 201-202 x85 204 175 x86 205-206 x87 208 x88 209-210 x89 211 x90 212 176 x91 213-218 x92 219-224 x93 225 x94 226 x95 228 177 x96 229-231 x97 232 x98 233-235 x99 236 x100 237 178 x101 238-242 x102 243-247 x103 248-259 x104 260-270 x105 271-275 179 x106 276-280 x107 281-291 x108 292-303 x109 304-310 x110 311-317 180 x111 318-324 x112 325-331 x113 332-338 x114 339-345 x115 346-352 181 x116 353-359 x117 360-366 x118 367-370 x119 371-374 x120 375-376 182 x121 377-378 x122 379 x123 380 x124 381 x125 382 183 x126 383 x127 384 x128 385 x129 386 184 msa 387-390 msarank 391-393 pmsarank 394-395 cccode 396 185 cr 397 186 ; 187 end; 188 run; NOTE: The infile RAW is: Pipe command="zcat /home/data/cps/cpsmar88.raw.Z" NOTE: The file OUT is: Pipe command="compress >~/bulk/cpsmw88.raw.Z" NOTE: 295459 records were read from the infile RAW. The minimum record length was 657. The maximum record length was 657. NOTE: 155980 records were written to the file OUT. The minimum record length was 397. The maximum record length was 397. NOTE: The data set WORK.DATA1 has 155980 observations and 136 variables. NOTE: DATA statement used: real time 2:00.85 cpu time 1:25.11 4 The SAS System 16:40 Monday, June 6, 2005 189 *proc freq ; 190 *table x4; 191 proc freq; table x39 x36; 192 run; NOTE: There were 155980 observations read from the data set WORK.DATA1. NOTE: The PROCEDURE FREQ printed pages 1-8. NOTE: PROCEDURE FREQ used: real time 1.59 seconds cpu time 1.15 seconds 192 ! endsas; NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 NOTE: The SAS System used: real time 2:03.26 cpu time 1:26.36