1 The SAS System 13:43 Tuesday, April 30, 2013 NOTE: Copyright (c) 2002-2010 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) Proprietary Software 9.3 (TS1M0) Licensed to NATIONAL BUREAU OF ECONOMIC RESEARCH, Site 70111350. NOTE: This session is executing on the Linux 2.6.32-358.2.1.el6.x86_64 (LIN X64) platform. 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.53 seconds cpu time 0.04 seconds 1 *options obs=55; 2 options mprint mlogic symbolgen; 3 options nocenter ; 4 *by Jean Roth, jroth@nber.org, 2007-11-09 ; 5 *NOTE: This program is distributed under the GNU GPL. See end of 6 *this file and http://www.gnu.org/licenses/ for details. ; 7 8 * The following line should contain the directory 9 where the SAS file is to be stored ; 10 11 *libname library "~/bulk/cost-reports/hosp/"; 12 libname library "."; NOTE: Libref LIBRARY was successfully assigned as follows: Engine: V9 Physical Name: /disk/data3/hcris/2552-96/temp2 13 14 * The following line should contain 15 the complete path and name of the raw data file. 16 On a PC, use backslashes in paths as in C:\ ; 17 18 %macro loop(FYEAR=,LYEAR=); 19 %do year=&FYEAR. %to &LYEAR.; 20 proc printto log ="./read_hosp_rpt_nmrc&year..log" new; 21 proc printto print="./read_hosp_rpt_nmrc&year..lst" new; 22 23 FILENAME datafile "/homes/data/hcris/fy/hosp_&year._NMRC.CSV"; 24 25 * The following line should contain the name of the SAS dataset ; 26 2 The SAS System 13:43 Tuesday, April 30, 2013 27 %let dataset = hosp_nmrc_rpt&year._long ; 28 29 30 data library.&dataset.; 31 *hosp_dm.* files report lengths; 32 LENGTH rpt_rec_num 5. wksht_cd $7. line_num $5. clmn_num $4. itm_val_num 7. ; 33 * '2C' is hexadecimal for decimal 44 which represents ',' ; 34 * '0D' is hexadecimal for decimal 13 which represents '\r', which is the carriage return character; 35 infile datafile dsd delimiter='2C0D'x ; 36 INPUT 37 38 rpt_rec_num 39 wksht_cd $ 40 line_num $ 41 clmn_num $ 42 itm_val_num 43 44 ; 45 46 proc means data=library.&dataset. n max; 47 title "Inspect maximums: Four bytes retain six significant digits" ; 48 run; 49 proc freq data=library.&dataset.; 50 title "" ; 51 tables wksht_cd clmn_num ; 52 proc freq order=freq data=library.&dataset.; 53 title "Ordered by freq" ; 54 tables wksht_cd clmn_num ; 55 proc sort data=library.&dataset; 56 by wksht_cd; 57 proc freq data=library.&dataset.; 58 title ""; 59 tables line_num; 60 by wksht_cd; 61 62 proc freq data=library.&dataset.; 63 tables clmn_num; 64 by wksht_cd; 65 proc sort data=library.&dataset. nodupkey out=library.uniq_nmrc_&year.; 66 by wksht_cd line_num clmn_num ; 67 68 %end; 69 %mend; 70 *%loop(FYEAR=1996,LYEAR=2011); 71 *%loop(FYEAR=2011,LYEAR=2011); 72 *%loop(FYEAR=2010,LYEAR=2010); 73 *%loop(FYEAR=2009,LYEAR=2009); 74 *%loop(FYEAR=2008,LYEAR=2008); 75 *%loop(FYEAR=2007,LYEAR=2007); 76 *%loop(FYEAR=2006,LYEAR=2006); 77 *%loop(FYEAR=2005,LYEAR=2005); 78 *%loop(FYEAR=2004,LYEAR=2004); 79 *%loop(FYEAR=2003,LYEAR=2003); 80 *%loop(FYEAR=2002,LYEAR=2002); 81 *%loop(FYEAR=2001,LYEAR=2001); 82 *%loop(FYEAR=2000,LYEAR=2000); 83 *%loop(FYEAR=1999,LYEAR=1999); 84 %loop(FYEAR=1998,LYEAR=1998); 3 The SAS System 13:43 Tuesday, April 30, 2013 MLOGIC(LOOP): Beginning execution. MLOGIC(LOOP): Parameter FYEAR has value 1998 MLOGIC(LOOP): Parameter LYEAR has value 1998 SYMBOLGEN: Macro variable FYEAR resolves to 1998 SYMBOLGEN: Macro variable LYEAR resolves to 1998 MLOGIC(LOOP): %DO loop beginning; index variable YEAR; start value is 1998; stop value is 1998; by value is 1. SYMBOLGEN: Macro variable YEAR resolves to 1998 MPRINT(LOOP): proc printto log ="./read_hosp_rpt_nmrc1998.log" new; NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 NOTE: The SAS System used: real time 1:12.78 cpu time 36.79 seconds