1 The SAS System 11:39 Tuesday, October 2, 2012 NOTE: Copyright (c) 2002-2008 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) Proprietary Software 9.2 (TS2M0) Licensed to UNIVERSITY OF SOUTHERN CALIFORNIA-SFA-T&R, Site 70095270. NOTE: This session is executing on the Linux 2.6.38-15-server (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.01 seconds cpu time 0.02 seconds 1 *options obs=55; 2 options nocenter ; 3 *by Jean Roth, jroth@nber.org, 2007-11-09 ; 4 *NOTE: This program is distributed under the GNU GPL. See end of 5 *this file and http://www.gnu.org/licenses/ for details. ; 6 7 * The following line should contain the directory 8 where the SAS file is to be stored ; 9 10 libname library "~/bulk/cost-reports/snf"; NOTE: Libref LIBRARY was successfully assigned as follows: Engine: V9 Physical Name: /homes/nber/jroth/bulk/cost-reports/snf 11 12 * The following line should contain 13 the complete path and name of the raw data file. 14 On a PC, use backslashes in paths as in C:\ ; 15 16 %macro loop; 17 %do year=&SYSPARM. %to &SYSPARM.; 18 proc printto log ="./read_snf_rpt_nmrc&year..log" new; 19 proc printto print="./read_snf_rpt_nmrc&year..lst"; 20 21 FILENAME datafile "/homes/data/hcris/snf1996/snf_&year._NMRC.CSV"; 22 23 * The following line should contain the name of the SAS dataset ; 24 25 %let dataset=snf_nmrc_rpt&year._long ; 26 2 The SAS System 11:39 Tuesday, October 2, 2012 27 28 data library.&dataset.; 29 *snf_dm.* files report lengths; 30 LENGTH rpt_rec_num 4. wksht_cd $7. line_num $5. clmn_num $4. itm_val_num 7. ; 31 * '2C' is hexadecimal for decimal 44 which represents ',' ; 32 * '0D' is hexadecimal for decimal 13 which represents '\r', which is the carriage return character; 33 infile datafile dsd delimiter='2C0D'x ; 34 INPUT 35 36 rpt_rec_num 37 wksht_cd $ 38 line_num $ 39 clmn_num $ 40 itm_val_num 41 42 ; 43 44 proc means data=library.&dataset. n max; 45 title "Inspect maximums: Four bytes retain six significant digits" ; 46 run; 47 proc freq data=library.&dataset.; 48 title "" ; 49 tables wksht_cd clmn_num ; 50 proc sort data=library.&dataset. nodupkey out = &dataset. ; 51 by wksht_cd line_num clmn_num ; 52 proc print data=&dataset. noobs ; 53 var wksht_cd clmn_num line_num; 54 55 %end; 56 %mend; 57 %loop; NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 4 The SAS System 11:39 Tuesday, October 2, 2012 NOTE: The SAS System used: real time 19.72 seconds cpu time 16.73 seconds