606 *********************************************; 607 * f=sasmanual\clinq_view.sas *; 608 * *; 609 * Clinical data set questions: *; 610 * I. Viewing the data *; 611 *********************************************; 612 613 options linesize=min; 614 615 %include 'c:\My Documents\My SAS 615! Files\sasmanual\formats\clinical_fmt.sas'; NOTE: Format $GENDER is already on the library. NOTE: Format $GENDER has been output. NOTE: Format $DXCODES is already on the library. NOTE: Format $DXCODES has been output. NOTE: Format $YESNO is already on the library. NOTE: Format $YESNO has been output. NOTE: PROCEDURE FORMAT used: real time 0.05 seconds 645 646 libname mydir 'c:\My Documents\My SAS Files\sasmanual\data' 646! ; NOTE: Libref MYDIR was successfully assigned as follows: Engine: V7 Physical Name: c:\My Documents\My SAS Files\sasmanual\data 647 648 data clin; 649 set mydir.clinical; 650 run; NOTE: The data set WORK.CLIN has 34 observations and 11 variables. NOTE: DATA statement used: real time 0.04 seconds 651 652 proc contents data=clin; 653 title1 'The simulated clinical data from the SAS manual'; 654 title2 'Question 1 - variables and their attributes'; 655 run; NOTE: PROCEDURE CONTENTS used: real time 0.16 seconds 656 657 proc print data=clin; 658 title2 'Question 2a - all variables for all obs'; 659 run; NOTE: PROCEDURE PRINT used: real time 0.05 seconds 660 661 proc print data=clin (obs=5) label; 662 var gender dbp sbp; 663 label gender = 'Gender of patient' 664 dbp = 'Diastolic blood pressure' 665 sbp = 'Systolic blood pressure'; 666 format gender $gender.; 667 title2 'Question 2b - 1st 5 obs, 3 variables, labels'; 668 run; NOTE: PROCEDURE PRINT used: real time 0.10 seconds 669 670 proc sort data=clin; 671 by gender; 672 run; NOTE: The data set WORK.CLIN has 34 observations and 11 variables. NOTE: PROCEDURE SORT used: real time 0.05 seconds 673 674 proc print data=clin label; 675 var gender dbp sbp; 676 label gender = 'Gender of patient' 677 dbp = 'Diastolic blood pressure' 678 sbp = 'Systolic blood pressure'; 679 format gender $gender.; 680 title2 'Question 2c - all obs, 3 variables, labels, sorted 680! 1 var'; 681 run; NOTE: PROCEDURE PRINT used: real time 0.10 seconds 682 683 proc sort data=clin; 684 by gender dbp; 685 run; NOTE: The data set WORK.CLIN has 34 observations and 11 variables. NOTE: PROCEDURE SORT used: real time 0.04 seconds 686 687 proc print data=clin label; 688 var dbp sbp; 689 id gender; 690 label gender = 'Gender of patient' 691 dbp = 'Diastolic blood pressure' 692 sbp = 'Systolic blood pressure'; 693 format gender $gender.; 694 title2 'Question 2d - all obs, 3 variables, labels, sorted 694! 2 vars'; 695 run; NOTE: PROCEDURE PRINT used: real time 0.10 seconds 696 697 698 proc format; 699 value $genx 'M' = 'Male adult' 700 'F' = 'Female adult'; NOTE: Format $GENX is already on the library. NOTE: Format $GENX has been output. 701 run; NOTE: PROCEDURE FORMAT used: real time 0.00 seconds 702 703 proc print data=clin; 704 var gender; 705 format gender $genx.; 706 title2 'Question 3 - change values for gender'; 707 run; NOTE: PROCEDURE PRINT used: real time 0.10 seconds