1 The SAS System 14:28 Friday, April 9, 2004 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.28 seconds cpu time 0.14 seconds 1 *options obs = 100 ; 2 ** by Jean Roth , jroth@nber.org , 2004-04-09 ; 3 ** Note: This program is distributed under the GNU GPL. See end of 4 ** this file and http://www.gnu.org/licenses/ for details. ; 5 options nocenter ; 6 options formdlim = " " ; 7 libname library './' ; NOTE: Libref LIBRARY was successfully assigned as follows: Engine: V8 Physical Name: /disk/nber10/SCCS/natality/pop 8 9 %let yr = 90 ; 10 filename raw pipe "unzip -p ./sasrh&yr..zip" ; 11 DATA library.sasrh&yr. ; 12 infile raw firstobs = 17 ; 13 ATTRIB 14 year length = 4 label = "Year ('MARS', '1990', '1991', ..., '1999')" 15 stresfip length = 3 label = "FIPS State Code" 16 age length = 3 label = "Age Group" 17 nhwm length = 5 label = "Non-Hispanic White Male" 18 nhwf length = 5 label = "Non-Hispanic White Female" 19 nhbm length = 5 label = "Non-Hispanic Black Male" 20 nhbf length = 5 label = "Non-Hispanic Black Female" 21 nhaianm length = 5 label = "Non-Hispanic American Indian and Alaska Native Male" 22 nhaianf length = 5 label = "Non-Hispanic American Indian and Alaska Native Female" 23 nhapim length = 5 label = "Non-Hispanic Asian and Pacific Islander Male" 24 nhapif length = 5 label = "Non-Hispanic Asian and Pacific Islander Female" 25 hwm length = 5 label = "Hispanic White Male" 26 hwf length = 5 label = "Hispanic White Female" 27 hbm length = 5 label = "Hispanic Black Male" 28 hbf length = 5 label = "Hispanic Black Female" 29 haianm length = 5 label = "Hispanic American Indian and Alaska Native Male" 30 haianf length = 5 label = "Hispanic American Indian and Alaska Native Female" 31 hapim length = 5 label = "Hispanic Asian and Pacific Islander Male" 32 hapif length = 5 label = "Hispanic Asian and Pacific Islander Female" 33 ; 34 INPUT 35 @1 year 4. 36 @6 stresfip 2. 2 The SAS System 14:28 Friday, April 9, 2004 37 @9 age 3. 38 @13 nhwm 7. 39 @20 nhwf 7. 40 @28 nhbm 7. 41 @35 nhbf 7. 42 @43 nhaianm 7. 43 @50 nhaianf 7. 44 @58 nhapim 7. 45 @65 nhapif 7. 46 @73 hwm 7. 47 @80 hwf 7. 48 @88 hbm 7. 49 @95 hbf 7. 50 @103 haianm 7. 51 @110 haianf 7. 52 @118 hapim 7. 53 @125 hapif 7. 54 ; NOTE: The infile RAW is: Pipe command="unzip -p ./sasrh90.zip" NOTE: 4386 records were read from the infile RAW. The minimum record length was 133. The maximum record length was 133. NOTE: The data set LIBRARY.SASRH90 has 4386 observations and 19 variables. NOTE: DATA statement used: real time 1.24 seconds cpu time 0.63 seconds 55 proc format ; 56 invalue mage8l 57 low - < 15 = 1 58 15 - 19 = 2 59 20 - 24 = 3 60 25 - 29 = 4 61 30 - 34 = 5 62 35 - 39 = 6 63 40 - 44 = 7 64 45 - 49 = 8 65 50 - 54 = 9 66 55 - high = . 67 ; NOTE: Informat MAGE8L has been output. 68 ** keep female variables only ; NOTE: PROCEDURE FORMAT used: real time 0.01 seconds cpu time 0.01 seconds 69 data pop&yr.r ( drop = nhwm nhbm nhaianm nhapim hwm hbm haianm hapim ) ; 70 set library.sasrh&yr. ; 71 if age >= 15 and age <= 54 ; 72 mage8 = input ( age , mage8l. ) ; 73 3 The SAS System 14:28 Friday, April 9, 2004 NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column). 72:17 NOTE: There were 4386 observations read from the data set LIBRARY.SASRH90. NOTE: The data set WORK.POP90R has 2040 observations and 12 variables. NOTE: DATA statement used: real time 0.19 seconds cpu time 0.10 seconds 74 proc print data = pop&yr.r ( obs = 12 ) ; 75 title "Raw data" ; 76 run; NOTE: There were 12 observations read from the data set WORK.POP90R. NOTE: The PROCEDURE PRINT printed page 1. NOTE: PROCEDURE PRINT used: real time 0.08 seconds cpu time 0.02 seconds 77 data pop&yr.t ( keep = year source stresfip age mage8 hispr2 mrace5 pop4 ) ; 78 set pop&yr.r ; 79 array hr nhwf -- hapif ; 80 do i = 1 to dim(hr) ; 81 pop4 = hr(i) ; 82 source = vname(hr(i)) ; 83 if i >= 1 and i <= 4 then do ; hispr2 = 1 ; end ; 84 else if i >= 5 and i <= 8 then do ; hispr2 = 2 ; end ; 85 if i in ( 1 , 5 ) then do ; mrace5 = 1 ; end ; 86 else if i in ( 2 , 6 ) then do ; mrace5 = 2 ; end ; 87 else if i in ( 3 , 7 ) then do ; mrace5 = 3 ; end ; 88 else if i in ( 4 , 8 ) then do ; mrace5 = 4 ; end ; 89 else do ; mrace5 = 5 ; end ; 90 output ; 91 end ; NOTE: There were 2040 observations read from the data set WORK.POP90R. NOTE: The data set WORK.POP90T has 16320 observations and 8 variables. NOTE: DATA statement used: real time 0.31 seconds cpu time 0.23 seconds 92 proc print data = pop&yr.t ( obs = 18 ) ; 93 title "Transposed data" ; 94 run; NOTE: There were 18 observations read from the data set WORK.POP90T. NOTE: The PROCEDURE PRINT printed page 2. NOTE: PROCEDURE PRINT used: real time 0.01 seconds cpu time 0.01 seconds 95 96 proc sort data = pop&yr.t ; 97 by year stresfip mage8 hispr2 mrace5 ; 4 The SAS System 14:28 Friday, April 9, 2004 NOTE: There were 16320 observations read from the data set WORK.POP90T. NOTE: The data set WORK.POP90T has 16320 observations and 8 variables. NOTE: PROCEDURE SORT used: real time 0.48 seconds cpu time 0.44 seconds 98 proc print data = pop&yr.t ( obs = 12 ) ; 99 title "Sorted" ; 100 run ; NOTE: There were 12 observations read from the data set WORK.POP90T. NOTE: The PROCEDURE PRINT printed page 3. NOTE: PROCEDURE PRINT used: real time 0.01 seconds cpu time 0.01 seconds 101 102 proc means noprint data = pop&yr.t sum ; 103 output out = library.pop&yr. ( drop = _TYPE_ _FREQ_ ) sum = pop4 ; 104 var pop4 ; 105 by year stresfip mage8 hispr2 mrace5 ; 106 run; NOTE: There were 16320 observations read from the data set WORK.POP90T. NOTE: The data set LIBRARY.POP90 has 3264 observations and 6 variables. NOTE: PROCEDURE MEANS used: real time 0.52 seconds cpu time 0.41 seconds 107 108 proc print data = library.pop&yr. ( obs = 18 ) ; 109 title "Population of Childbearing Age U.S. Resident Women Age by Age Groups, Sex, and Hispanic Origin" ; 110 111 /* 112 Copyright 2004 shared by the National Bureau of Economic Research and Jean Roth 113 114 National Bureau of Economic Research. 115 1050 Massachusetts Avenue 116 Cambridge, MA 02138 117 jroth@nber.org 118 119 This program and all programs referenced in it are free software. You 120 can redistribute the program or modify it under the terms of the GNU 121 General Public License as published by the Free Software Foundation; 122 either version 2 of the License, or (at your option) any later version. 123 124 This program is distributed in the hope that it will be useful, 125 but WITHOUT ANY WARRANTY; without even the implied warranty of 126 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 127 GNU General Public License for more details. 128 129 You should have received a copy of the GNU General Public License 130 along with this program; if not, write to the Free Software 131 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 132 USA. 5 The SAS System 14:28 Friday, April 9, 2004 133 */ 134 NOTE: There were 18 observations read from the data set LIBRARY.POP90. NOTE: The PROCEDURE PRINT printed page 4. NOTE: PROCEDURE PRINT used: real time 0.03 seconds cpu time 0.01 seconds NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 NOTE: The SAS System used: real time 3.77 seconds cpu time 2.05 seconds