Home
Contents
GENERAL GUIDELINES:
Windows in SAS
File management
The SAS Program
Program syntax
Debugging tips
USING SAS PROGRAMMING TO:
1. Prepare the data set
Types of data
Example programs
2. View the data
SAS Procedures
3. Explore the data
Numeric statistics
Frequency tables
4. Manipulate the data
Basic techniques
New variables
5. Adding Variables and
Observations to Data Sets
The SET Statement
The MERGE Statement
6. Data Processing
ARRAY Statement
Do Loops
By-Group Processing
RETAIN Statement
NON-PROGRAMMING
Alternatives
SAMPLE DATA SETS:
Height/weight
Height/weight/region
Simulated clinical data
Simulated Manitoba Health
|
Sample Data Sets: Clinical - Output
Note the difference below regarding the labelling of values in the output of
PROC PRINT when the FORMAT statement was added. Page 2 shows unformatted values
while page 3 shows formatted values, e.g., PRIM_DX shows a value of '01' for
the first observation on page 2; the formatted output assigns a value label
of 'Cold' this diagnosis.
The SAS System 1
11:49 Tuesday, July 27, 1999
The CONTENTS Procedure
Data Set Name: MYDIR.CLINICAL Observations: 34
Member Type: DATA Variables: 11
Engine: V7 Indexes: 0
Created: 13:27 Tuesday, Observation Length: 56
July 27, 1999
Last Modified: 13:27 Tuesday, Deleted Observations: 0
July 27, 1999
Protection: Compressed: NO
Data Set Type: Sorted: NO
Label:
-----Engine/Host Dependent Information-----
Data Set Page Size: 8192
Number of Data Set Pages: 1
First Data Page: 1
Max Obs per Page: 145
Obs in First Data Page: 34
Number of Data Set Repairs: 0
File Name: c:\My Documents\My SAS
Files\sasmanual\data\
clinical.sas7bdat
Release Created: 7.00.00P
Host Created: WIN_95
-----Alphabetic List of Variables and Attributes-----
# Variable Type Len Pos Label
----------------------------------------------------------------
9 dbp Num 8 32 Diastolic Blood Pressure
3 dob Num 8 0 Date of Birth
2 gender Char 1 43 Gender
7 hr Num 8 16 Heart Rate
1 id Char 3 40 Pt. Number
11 pregnant Char 1 49 Is Pt. Pregnant?
5 prim_dx Char 2 44 Primary DX
8 sbp Num 8 24 Systolic Blood Pressure
6 sec_dx Char 2 46 Secondary DX
4 visit Num 8 8 Visit Date
10 vitamins Char 1 48 Pt. Taking Vitamins?
The SAS System 2
11:49 Tuesday, July 27, 1999
v p
p i r
g r s t e
e v i e a g
n i m c m n
O d d s _ _ s d i a
b i e o i d d h b b n n
s d r b t x x r p p s t
1 123 M -4820 12918 01 05 62 136 76 1 0
2 278 F -1522 12918 04 68 104 64 0 0
3 444 F 2015 12919 01 78 128 62 1 1
4 756 M 1089 12945 07 09 66 150 96 0 0
5 811 F 5541 12935 05 06 88 166 74 0 0
6 193 F -83 13010 04 70 112 68 1 1
7 M 13071 13194 04 80 98 54 1 0
8 978 M 12597 12966 04 09 88 98 62 1 0
9 586 M 18235 12921 05 06 86 162 96 1 0
10 919 F 12302 12954 11 92 58 50 1 0
11 529 M -3459 13004 10 58 114 76 0 0
12 324 F 18263 . 06 86 200 100 1 0
13 012 F 17814 . 03 08 90 184 98 0 0
14 812 M 2840 13066 08 66 134 82 1 0
15 338 M 11166 12976 11 82 106 70 1 0
16 959 F 2175 13098 07 09 88 176 98 1 0
17 007 F 1570 12820 04 74 106 64 1 1
18 291 M 5699 12937 01 11 68 132 86 0 0
19 984 F 7296 12918 02 74 96 62 0 1
20 669 M 6268 12971 09 62 140 90 0 0
21 999 F 12784 12450 01 80 188 102 0 0
22 229 F 7474 13044 09 74 104 60 1 0
23 885 M 9384 13071 11 09 88 114 84 0 0
24 178 M 11385 12980 01 09 88 102 68 0 0
25 F 10958 13154 05 06 70 120 80 0 0
26 966 F 11417 13011 01 09 92 54 36 1 0
27 782 M 18420 12921 05 06 88 220 180 0 0
28 374 M 10353 12986 04 83 120 70 0 0
29 285 F 3810 13037 11 84 160 96 0 0
30 884 M 20647 13037 05 78 190 140 0 0
31 258 M 8256 13105 04 72 144 98 0 0
32 733 F 6826 12846 07 02 74 120 70 1 1
33 449 M -10310 13074 01 . . . 1 0
34 941 F 3935 13075 03 04 88 190 110 0 1
The SAS System 3
11:49 Tuesday, July 27, 1999
Obs id gender dob visit prim_dx
1 123 Male 10/21/46 05/15/95 Cold
2 278 Female 11/01/55 05/15/95 Routine Physical
3 444 Female 07/08/65 05/16/95 Cold
4 756 Male 12/25/62 06/11/95 Abdominal Pain
5 811 Female 03/04/75 06/01/95 Heart Problem
6 193 Female 10/10/59 08/15/95 Routine Physical
7 Male 10/15/95 02/15/96 Routine Physical
8 978 Male 06/28/94 07/02/95 Routine Physical
9 586 Male 12/04/09 05/18/95 Heart Problem
10 919 Female 09/06/93 06/20/95 Ear Ache
11 529 Male 07/13/50 08/09/95 Lyme disease
12 324 Female 01/01/10 . Lung Disorder
13 012 Female 10/09/08 . Fracture
14 812 Male 10/11/67 10/10/95 Laceration
15 338 Male 07/28/90 07/12/95 Ear Ache
16 959 Female 12/15/65 11/11/95 Abdominal Pain
17 007 Female 04/19/64 02/06/95 Routine Physical
18 291 Male 08/09/75 06/03/95 Cold
19 984 Female 12/23/79 05/15/95 Flu
20 669 Male 02/28/77 07/07/95 Immunization
21 999 Female 01/01/95 02/01/94 Cold
22 229 Female 06/18/80 09/18/95 Immunization
23 885 Male 09/10/85 10/15/95 Ear Ache
Obs sec_dx hr sbp dbp vitamins pregnant
1 Heart Problem 62 136 76 Yes No
2 68 104 64 No No
3 78 128 62 Yes Yes
4 Immunization 66 150 96 No No
5 Lung Disorder 88 166 74 No No
6 70 112 68 Yes Yes
7 80 98 54 Yes No
8 Immunization 88 98 62 Yes No
9 Lung Disorder 86 162 96 Yes No
10 92 58 50 Yes No
11 58 114 76 No No
12 86 200 100 Yes No
13 Laceration 90 184 98 No No
14 66 134 82 Yes No
15 82 106 70 Yes No
16 Immunization 88 176 98 Yes No
17 74 106 64 Yes Yes
18 Ear Ache 68 132 86 No No
19 74 96 62 No Yes
20 62 140 90 No No
21 80 188 102 No No
22 74 104 60 Yes No
23 Immunization 88 114 84 No No
The SAS System 4
11:49 Tuesday, July 27, 1999
Obs id gender dob visit prim_dx
24 178 Male 03/04/91 07/16/95 Cold
25 Female 01/01/90 01/06/96 Heart Problem
26 966 Female 04/05/91 08/16/95 Cold
27 782 Male 06/07/10 05/18/95 Heart Problem
28 374 Male 05/06/88 07/22/95 Routine Physical
29 285 Female 06/07/70 09/11/95 Ear Ache
30 884 Male 07/12/16 09/11/95 Heart Problem
31 258 Male 08/09/82 11/18/95 Routine Physical
32 733 Female 09/09/78 03/04/95 Abdominal Pain
33 449 Male 10/10/31 10/18/95 Cold
34 941 Female 10/10/70 10/19/95 Fracture
Obs sec_dx hr sbp dbp vitamins pregnant
24 Immunization 88 102 68 No No
25 Lung Disorder 70 120 80 No No
26 Immunization 92 54 36 Yes No
27 Lung Disorder 88 220 180 No No
28 83 120 70 No No
29 84 160 96 No No
30 78 190 140 No No
31 72 144 98 No No
32 Flu 74 120 70 Yes Yes
33 . . . Yes No
34 Routine Physical 88 190 110 No Yes
|
Contact: Charles Burchill
Telephone: (204) 789-3429
Manitoba Centre
for Health Policy
Department of Community Health Sciences,
University of Manitoba
4th floor Brodie Centre
408 - 727 McDermot Avenue
Winnipeg, Manitoba
R3E 3P5
Fax: (204) 789-3910
|