1 The SAS System 14:15 Wednesday, October 5, 2005 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.70 seconds cpu time 0.11 seconds 1 *options obs = 100 ; 2 options nocenter ; 3 4 /*------------------------------------------------ 5 by Jean Roth Wed Oct 5 11:41:17 EDT 2005 6 This program reads the National Drug Code 7 firms Data File 8 Report errors to jroth@nber.org 9 This program is distributed under the GNU GPL. 10 See end of this file and 11 http://www.gnu.org/licenses/ for details. 12 ----------------------------------------------- */ 13 14 15 * The following line should contain the directory where the SAS file is to be stored ; 16 17 libname library "./"; NOTE: Libref LIBRARY was successfully assigned as follows: Engine: V8 Physical Name: /disk/nber10/SCCS/ndc 18 19 * The following line should contain 20 the complete path and name of the raw data file. 21 On a PC, use backslashes in paths as in C:\ ; 22 23 FILENAME datafile pipe "gunzip -dc /homes/data/ndc/firms.dat.gz "; 24 25 * The following line should contain the name of the SAS dataset ; 26 27 %let dataset = firms ; 28 29 DATA library.&dataset ; 30 31 INFILE datafile LRECL = 343 missover pad ; 32 33 attrib firm_seq_no length=5 label="FDA generated unique identification number for each firm"; 34 attrib lblcode length=$6 ; 35 attrib firm_name length=$65 ; 2 The SAS System 14:15 Wednesday, October 5, 2005 36 attrib addr_header length=$65 ; 37 attrib street length=$40 ; 38 attrib po_box length=$9 ; 39 attrib foreign_addr length=$40 ; 40 attrib city length=$30 ; 41 attrib state length=$2 ; 42 attrib province length=$30 ; 43 attrib zip length=$9 ; 44 attrib country_name length=$40 ; 45 46 INPUT 47 48 FIRM_SEQ_NO 1-7 49 LBLCODE $ 8-13 50 FIRM_NAME $ 14-78 51 ADDR_HEADER $ 79-143 52 STREET $ 144-183 53 PO_BOX $ 184-192 54 FOREIGN_ADDR $ 193-232 55 CITY $ 233-262 56 STATE $ 263-264 57 PROVINCE $ 265-294 58 ZIP $ 295-303 59 @304 COUNTRY_NAME $40. 60 61 ; 62 NOTE: The infile DATAFILE is: Pipe command="gunzip -dc /homes/data/ndc/firms.dat.gz " NOTE: 3134 records were read from the infile DATAFILE. The minimum record length was 308. The maximum record length was 322. NOTE: The data set LIBRARY.FIRMS has 3134 observations and 12 variables. NOTE: DATA statement used: real time 5.21 seconds cpu time 0.52 seconds 63 proc print data = library.&dataset ( obs = 10 ) ; 64 NOTE: There were 10 observations read from the data set LIBRARY.FIRMS. NOTE: The PROCEDURE PRINT printed page 1. NOTE: PROCEDURE PRINT used: real time 1.55 seconds cpu time 0.06 seconds 65 proc contents data = library.&dataset ; NOTE: The PROCEDURE CONTENTS printed page 2. NOTE: PROCEDURE CONTENTS used: real time 1.45 seconds cpu time 0.04 seconds NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 3 The SAS System 14:15 Wednesday, October 5, 2005 NOTE: The SAS System used: real time 9.46 seconds cpu time 0.80 seconds