193 *********************************************; 194 * Clinical data set questions: *; 195 * VI. Data Processing *; 196 *********************************************; 197 198 options linesize=min; 199 200 libname mydir 'c:\My Documents\My SAS Files\sasmanual\data' 200! ; NOTE: Libref MYDIR was successfully assigned as follows: Engine: V7 Physical Name: c:\My Documents\My SAS Files\sasmanual\data 201 data bygroup; 202 set mydir.clinical; 203 run; NOTE: There were 34 observations read from the data set MYDIR.CLINICAL. NOTE: The data set WORK.BYGROUP has 34 observations and 11 variables. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.01 seconds 204 205 proc sort data=bygroup; 206 by prim_dx; 207 run; NOTE: There were 34 observations read from the data set WORK.BYGROUP. NOTE: The data set WORK.BYGROUP has 34 observations and 11 variables. NOTE: PROCEDURE SORT used (Total process time): real time 0.03 seconds cpu time 0.03 seconds 208 209 data bygroup; 210 set bygroup; 211 by prim_dx; 212 first_prim_dx=first.prim_dx; 213 last_prim_dx=last.prim_dx; 214 run; NOTE: There were 34 observations read from the data set WORK.BYGROUP. NOTE: The data set WORK.BYGROUP has 34 observations and 13 variables. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.01 seconds 215 216 proc print data=bygroup; 217 var id gender dob prim_dx first_prim_dx last_prim_dx; 218 format prim_dx sec_dx $dxcodes. 219 dob visit mmddyy8. 220 gender $gender. 221 vitamins pregnant $yesno.; 222 run; NOTE: There were 34 observations read from the data set WORK.BYGROUP. NOTE: PROCEDURE PRINT used (Total process time): real time 0.04 seconds cpu time 0.01 seconds 223 224 proc sort data=bygroup; 225 by prim_dx; 226 run; NOTE: There were 34 observations read from the data set WORK.BYGROUP. NOTE: The data set WORK.BYGROUP has 34 observations and 13 variables. NOTE: PROCEDURE SORT used (Total process time): real time 0.03 seconds cpu time 0.03 seconds 227 228 data c_bygroup; 229 set bygroup; 230 retain count; 231 if first_prim_dx then do; 232 count=0; 233 end; 234 count=count+1; 235 run; NOTE: There were 34 observations read from the data set WORK.BYGROUP. NOTE: The data set WORK.C_BYGROUP has 34 observations and 14 variables. NOTE: DATA statement used (Total process time): real time 0.03 seconds cpu time 0.03 seconds 236 237 proc print data=c_bygroup; 238 format prim_dx sec_dx $dxcodes. 239 dob visit mmddyy8. 240 gender $gender. 241 vitamins pregnant $yesno.; 242 run; NOTE: There were 34 observations read from the data set WORK.C_BYGROUP. NOTE: PROCEDURE PRINT used (Total process time): real time 0.04 seconds cpu time 0.03 seconds