1 The SAS System 14:57 Tuesday, April 3, 2007 NOTE: Copyright (c) 2002-2003 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) 9.1 (TS1M3) Licensed to HARVARD SCHOOL OF PUBLIC HEALTH-INSTRUCTIONAL COMP, Site 0001177014. NOTE: This session is executing on the SunOS 5.9 platform. NOTE: SAS 9.1.3 Service Pack 3 ----------------------------------------------------------------------- NBER NOTE: sas now defaults to sas9. sas8 or sas6 will invoke sas version 8 or 6 respectively. - 2005/10/21 ----------------------------------------------------------------------- You are running SAS 9. Some SAS 8 files will be automatically converted by the V9 engine; others are incompatible. Please see http://support.sas.com/rnd/migration/planning/platform/64bit.html PROC MIGRATE will preserve current SAS file attributes and is recommended for converting all your SAS libraries from any SAS 8 release to SAS 9. For details and examples, please see http://support.sas.com/rnd/migration/index.html This message is contained in the SAS news file, and is presented upon initialization. Edit the file "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.80 seconds cpu time 0.18 seconds 1 *options obs=100 ; 2 options nocenter ; 3 4 /*------------------------------------------------ 5 by Jean Roth Wed Oct 11 11:31:00 EDT 2006 6 This program reads the 2003 CES Interview Data Files 7 FMLY = Consumer Unit (CU) Characteristics and Income File 8 MEMB = Member Characteristics and Income File 9 MTAB = Montly Expenditures 10 ITAB = Income 11 Report errors to jroth@nber.org 12 This program is distributed under the GNU GPL. 13 See end of this file and 14 http://www.gnu.org/licenses/ for details. 15 ----------------------------------------------- */ 16 17 * The following line should contain the directory 18 where the SAS file is to be stored ; 19 20 libname library "./"; NOTE: Libref LIBRARY was successfully assigned as follows: Engine: V9 Physical Name: /disk/nber10/SCCS/ces/2003/interview 2 The SAS System 14:57 Tuesday, April 3, 2007 21 22 * The following line should contain 23 the complete path and name of the raw data file. 24 On a PC, use backslashes in paths as in C:\ ; 25 26 %macro loop(qtr=,ty=); 27 %let dataset=&ty.&qtr.; 28 %let includeit=i&ty..txt; 29 %if &qtr.=031x and (&ty.=fmlyi or &ty.=membi) %then %do; %let includeit=i&ty.x.txt; %end; 30 *%let %includeit="/homes/nber/jroth/text/str70.txt"; 31 32 DATA &dataset ; 33 34 INFILE "/homes/data/ces/2003/interview/&dataset..txt" LRECL = 20000 ; 35 36 INPUT 37 %include "&includeit."; 38 ; 39 40 proc sort data=&dataset. out=library.&dataset.; 41 by newid; 42 43 proc print data=library.&dataset. (obs=5); 44 proc contents data=library.&dataset.; 45 %mend; 46 *%loop(qtr=031x,ty=fmlyi); 47 *%loop(qtr=032,ty=fmlyi); 48 *%loop(qtr=033,ty=fmlyi); 49 *%loop(qtr=034,ty=fmlyi); 50 *%loop(qtr=041,ty=fmlyi); 51 %loop(qtr=031x,ty=membi); WARNING: Apparent invocation of macro INCLUDEIT not resolved. ERROR: Expecting a variable name after %LET. ERROR: Symbolic variable name %INCLUDEIT must begin with a letter or underscore. ERROR: The macro LOOP will stop executing. 52 *%loop(qtr=032,ty=membi); 53 *%loop(qtr=033,ty=membi); 54 *%loop(qtr=034,ty=membi); 55 *%loop(qtr=041,ty=membi); 56 *%loop(qtr=031x,ty=mtabi); 57 *%loop(qtr=032,ty=mtabi); 58 *%loop(qtr=033,ty=mtabi); 59 *%loop(qtr=034,ty=mtabi); 60 *%loop(qtr=041,ty=mtabi); 61 *%loop(qtr=031x,ty=itabi); 62 *%loop(qtr=032,ty=itabi); 63 *%loop(qtr=033,ty=itabi); 64 *%loop(qtr=034,ty=itabi); 65 *%loop(qtr=041,ty=itabi); 66 *%loop(qtr=031x,ty=itabi); ERROR: Errors printed on page 2. NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 NOTE: The SAS System used: real time 0.83 seconds cpu time 0.21 seconds