405 ***********************************************; 406 * f=sasmanual\clinq_bastech.sas *; 407 * *; 408 * Clinical data * 409 * IV. Manipulating the data (basic techniques)*; 410 ***********************************************; 411 412 options linesize=min; 413 414 libname mydir 'c:\My Documents\My SAS Files\sasmanual\data' 414! ; NOTE: Libref MYDIR was successfully assigned as follows: Engine: V7 Physical Name: c:\My Documents\My SAS Files\sasmanual\data 415 416 data one; 417 set mydir.clinical; 418 if pregnant='1' and gender='F'; 419 run; NOTE: The data set WORK.ONE has 6 observations and 11 variables. NOTE: DATA statement used: real time 0.15 seconds 420 421 proc freq data=one; 422 tables pregnant * gender; 423 title1 'The simulated clinical data from the SAS manual'; 424 title2 'Subset of pregnant females'; 425 run; NOTE: PROCEDURE FREQ used: real time 0.22 seconds 426 427 data two; 428 set mydir.clinical (keep=id sbp dbp hr); 429 run; NOTE: The data set WORK.TWO has 34 observations and 4 variables. NOTE: DATA statement used: real time 0.16 seconds 430 431 proc contents data=two; 432 title2 'Subset of 4 variables'; 433 run; NOTE: PROCEDURE CONTENTS used: real time 1.15 seconds 434 435 data three; 436 set mydir.clinical (obs=15); 437 run; NOTE: The data set WORK.THREE has 15 observations and 11 variables. NOTE: DATA statement used: real time 0.16 seconds 438 439 proc contents data=three; 440 title2 'Subset of 15 observations'; 441 run; NOTE: PROCEDURE CONTENTS used: real time 0.16 seconds 442 443 title1; 444 title2; 445 446 proc freq data=mydir.clinical; 447 tables pregnant * vitamins; 448 run; NOTE: PROCEDURE FREQ used: real time 0.10 seconds 449 450 proc format; 451 value $pregnew '1' = '3+mos. pregnant' 452 '0' = 'LT 3 mos. pregnant'; NOTE: Format $PREGNEW has been output. 453 run; NOTE: PROCEDURE FORMAT used: real time 0.16 seconds 454 455 data clin; 456 set mydir.clinical; 457 label vitamins = 'Patient on vitamin therapy'; 458 run; NOTE: The data set WORK.CLIN has 34 observations and 11 variables. NOTE: DATA statement used: real time 0.04 seconds 459 460 proc freq data=clin; 461 tables pregnant * vitamins; 462 format pregnant $pregnew.; 463 title1 'The simulated clinical data from the SAS manual'; 464 footnote1 'Customizing output'; 465 run; NOTE: PROCEDURE FREQ used: real time 0.21 seconds