1 The SAS System 17:34 Monday, April 15, 2019 NOTE: Copyright (c) 2002-2012 by SAS Institute Inc., Cary, NC, USA. NOTE: SAS (r) Proprietary Software 9.4 (TS1M3 MBCS3170) Licensed to NATIONAL BUREAU OF ECONOMIC RESEARCH, Site 70111350. NOTE: This session is executing on the Linux 3.10.0-957.1.3.el7.x86_64 (LIN X64) platform. NOTE: Updated analytical products: SAS/STAT 14.1 NOTE: Additional host information: Linux LIN X64 3.10.0-957.1.3.el7.x86_64 #1 SMP Mon Nov 26 12:36:06 CST 2018 x86_64 Scientific Linux release 7.6 (Nitrogen) 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.04 seconds cpu time 0.01 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 "~/bulk/cost-reports/hosp/"; 11 libname library "/homes/data/hcris/2552-96"; NOTE: Libref LIBRARY was successfully assigned as follows: Engine: V9 Physical Name: /homes/data/hcris/2552-96 12 13 * The following line should contain 14 the complete path and name of the raw data file. 2 The SAS System 17:34 Monday, April 15, 2019 15 On a PC, use backslashes in paths as in C:\ ; 16 17 %macro loop(FYEAR=,LYEAR=); 18 %do year=&FYEAR. %to &LYEAR.; 19 proc printto log ="/homes/data/hcris/2552-96/read_hosp_rpt_rollup&year..log" new; 20 proc printto print="/homes/data/hcris/2552-96/read_hosp_rpt_rollup&year..lst" new; 21 22 FILENAME datafile "/homes/data/hcris/2552-96/hosp_&year._ROLLUP.CSV"; 23 24 * The following line should contain the name of the SAS dataset ; 25 26 %let dataset=library.hosp_rollup2552_96_&year.; 27 28 data &dataset.; 29 30 *hosp_dm.* files report lengths; 31 *Using a length of 4 bytes retains 6 significant digits; 32 *Largest integer represented exactly is 2,097,152; 33 *Maximum values apply to 2002-09-30 data file; 34 *max date is around 16000, do length of 4 should be fine for dates; 35 LENGTH rpt_rec_num 5 label $30; 36 * '2C' is hexadecimal for decimal 44 which represents ',' ; 37 * '0D' is hexadecimal for decimal 13 which represents '\r', which is the carriage return character; 38 infile datafile dsd delimiter='2C0D'x ; 39 ** the ":" is a format modifier that reads data values 40 that need additional instructions from an informat; 41 INPUT 42 rpt_rec_num 43 label $ 44 item 45 ; 46 LABEL 47 rpt_rec_num="Report Record Number" 48 ; 49 proc sort data=&dataset.; 50 by rpt_rec_num; 51 52 proc transpose data=&dataset. out=&dataset. (drop=_NAME_ sortedby=rpt_rec_num); 53 by rpt_rec_num; 54 var item; 55 id label; 56 run; 57 58 proc print DATA=&dataset. (obs=5); 59 proc contents DATA=&dataset.; 60 61 %end; 62 %mend; 63 *%loop(FYEAR=1996,LYEAR=2011); 64 *%loop(FYEAR=2005,LYEAR=2011); 65 *%loop(FYEAR=1995,LYEAR=1995); 66 %loop(FYEAR=1995,LYEAR=2011); MLOGIC(LOOP): Beginning execution. MLOGIC(LOOP): Parameter FYEAR has value 1995 MLOGIC(LOOP): Parameter LYEAR has value 2011 SYMBOLGEN: Macro variable FYEAR resolves to 1995 SYMBOLGEN: Macro variable LYEAR resolves to 2011 MLOGIC(LOOP): %DO loop beginning; index variable YEAR; start value is 1995; stop value is 2011; by value is 1. 3 The SAS System 17:34 Monday, April 15, 2019 SYMBOLGEN: Macro variable YEAR resolves to 1995 MPRINT(LOOP): proc printto log ="/homes/data/hcris/2552-96/read_hosp_rpt_rollup1995.log" new; NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 NOTE: The SAS System used: real time 2:22.78 cpu time 2:01.67