1 The SAS System 11:27 Tuesday, April 5, 2016 NOTE: Copyright (c) 2002-2012 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) Proprietary Software 9.4 (TS1M3) Licensed to NATIONAL BUREAU OF ECONOMIC RESEARCH, Site 70111351. NOTE: This session is executing on the Linux 2.6.32-573.12.1.el6.x86_64 (LIN X64) platform. NOTE: Updated analytical products: SAS/STAT 14.1 NOTE: Additional host information: Linux LIN X64 2.6.32-573.12.1.el6.x86_64 #1 SMP Tue Dec 15 08:24:23 CST 2015 x86_64 Scientific Linux release 6.7 (Carbon) 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.72 seconds cpu time 0.02 seconds 1 ptions nocenter ; ______ 14 WARNING 14-169: Assuming the symbol OPTIONS was misspelled as ptions. 2 options mprint mlogic symbolgen; 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 "/homes/data/hcris/1984-99"; NOTE: Libref LIBRARY was successfully assigned as follows: Engine: V9 Physical Name: /homes/data/hcris/1984-99 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:\ ; 2 The SAS System 11:27 Tuesday, April 5, 2016 15 16 %macro loop(FYEAR=,LYEAR=); 17 %do year=&FYEAR. %to &LYEAR.; 18 proc printto log ="/homes/data/hcris/1984-99/read_hospc_rpt_rollup&year..log" new; 19 proc printto print="/homes/data/hcris/1984-99/read_hospc_rpt_rollup&year..lst" new; 20 21 FILENAME datafile "/homes/data/hcris/1984-99/HOSPC_&year._ROLLUP.CSV"; 22 23 * The following line should contain the name of the SAS dataset ; 24 25 %let dataset=library.hospc_rollup1984_99_&year.; 26 27 data &dataset.; 28 29 *Using a length of 4 bytes retains 6 significant digits; 30 *max date is around 16000, do length of 4 should be fine for dates; 31 LENGTH rpt_rec_num 5 label $30; 32 * '2C' is hexadecimal for decimal 44 which represents ',' ; 33 * '0D' is hexadecimal for decimal 13 which represents '\r', which is the carriage return character; 34 infile datafile dsd delimiter='2C0D'x ; 35 ** the ":" is a format modifier that reads data values 36 that need additional instructions from an informat; 37 INPUT 38 rpt_rec_num 39 label $ 40 item 41 ; 42 LABEL 43 rpt_rec_num="Report Record Number" 44 ; 45 proc sort data=&dataset.; 46 by rpt_rec_num; 47 48 proc transpose data=&dataset. out=&dataset. (drop=_NAME_ sortedby=rpt_rec_num); 49 by rpt_rec_num; 50 var item; 51 id label; 52 run; 53 54 proc print DATA=&dataset. (obs=5); 55 proc contents DATA=&dataset.; 56 57 %end; 58 %mend; 59 *%loop(FYEAR=1999,LYEAR=2014); 60 *%loop(FYEAR=1999,LYEAR=2014); 61 %loop(FYEAR=1999,LYEAR=2014); MLOGIC(LOOP): Beginning execution. MLOGIC(LOOP): Parameter FYEAR has value 1999 MLOGIC(LOOP): Parameter LYEAR has value 2014 SYMBOLGEN: Macro variable FYEAR resolves to 1999 SYMBOLGEN: Macro variable LYEAR resolves to 2014 MLOGIC(LOOP): %DO loop beginning; index variable YEAR; start value is 1999; stop value is 2014; by value is 1. SYMBOLGEN: Macro variable YEAR resolves to 1999 MPRINT(LOOP): proc printto log ="/homes/data/hcris/1984-99/read_hospc_rpt_rollup1999.log" new; NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 NOTE: The SAS System used: real time 2.87 seconds cpu time 0.26 seconds