1 The SAS System 17:21 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.05 seconds cpu time 0.02 seconds 1 options nocenter ; 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/2552-96"; NOTE: Libref LIBRARY was successfully assigned as follows: Engine: V9 Physical Name: /homes/data/hcris/2552-96 11 12 PROC FORMAT CNTLOUT=library.fhosp_rpt; NOTE: Data file LIBRARY.FHOSP_RPT.DATA is in a format that is native to another host, or the file encoding does not match the session encoding. Cross Environment Data Access will be used, which might require additional CPU resources and might reduce performance. 13 **************************************************; 14 ** The PROC FORMAT statements will store the formats in a sas data set; 15 ** Use the stored formats in subsequent programs like this: ; 2 The SAS System 17:21 Monday, April 15, 2019 16 ** proc format cntlin=library.fhosp_rpt; 17 ** PROC freq; 18 ** tables adr_vndr_cd util_cd ; 19 ** format adr_vndr_cd adr_vndr_cd.; 20 ** format util_cd $util_cd.; 21 ** Consult the SAS Procedures Guide PROC FORMAT section; 22 **************************************************; 23 VALUE prvdr_ctrl_type_cd 24 1 = "Voluntary Nonprofit, Church" 25 2 = "Voluntary Nonprofit, Other" 26 3 = "Proprietary, Individual" 27 4 = "Proprietary, Corporation" 28 5 = "Proprietary, Partnership" 29 6 = "Proprietary, Other" 30 7 = "Governmental, Federal" 31 8 = "Governmental, City-County" 32 9 = "Governmental, County" 33 10 = "Governmental, State" 34 11 = "Governmental Hospital District" 35 12 = "Governmental, City" 36 13 = "Governmental, Other" 37 ; NOTE: Format PRVDR_CTRL_TYPE_CD has been output. 38 VALUE rpt_stus_cd 39 1 = "As Submitted" 40 2 = "Settled w/o Audit" 41 3 = "Settled with Audit" 42 4 = "Reopened" 43 ; NOTE: Format RPT_STUS_CD has been output. 44 VALUE $initl_rpt_sw 45 "Y" = "first cost report filed for this provider" 46 "N" = "2nd+ report for this provider" 47 ; NOTE: Format $INITL_RPT_SW has been output. 48 VALUE $last_rpt_sw 49 "Y" = "last cost report filed for this provider" 50 "N" = "not last report for this provider" 51 ; NOTE: Format $LAST_RPT_SW has been output. 52 VALUE adr_vndr_cd 53 2 = "E & Y" 54 3 = "KPMG" 55 4 = " HFS" 56 ; NOTE: Format ADR_VNDR_CD has been output. 57 VALUE $util_cd 58 "L" = "Low Medicare Util" 59 "N" = "No Medicare Util" 60 "F" = "Full Medicare Util" 61 ; NOTE: Format $UTIL_CD has been output. 62 63 * The following line should contain 64 the complete path and name of the raw data file. 65 On a PC, use backslashes in paths as in C:\ ; 66 67 %macro loop(FYEAR=,LYEAR=); 3 The SAS System 17:21 Monday, April 15, 2019 68 %do year=&FYEAR. %to &LYEAR.; 69 proc printto log ="/homes/data/hcris/2552-96/read_hosp_rpt&year..log" new; 70 proc printto print="/homes/data/hcris/2552-96/read_hosp_rpt&year..lst" new; 71 72 FILENAME datafile "/homes/data/hcris/2552-96/hosp_&year._RPT.CSV"; 73 74 * The following line should contain the name of the SAS dataset ; 75 76 %let dataset=library.hosp_rpt2552_96_&year.; 77 78 data &dataset.; 79 80 *hosp_dm.* files report lengths; 81 *Using a length of 4 bytes retains 6 significant digits; 82 *Largest integer represented exactly is 2,097,152; 83 *Maximum values apply to 2002-09-30 data file; 84 *max date is around 16000, do length of 4 should be fine for dates; 85 *Variable Maximum 86 --------- ------- 87 RPT_REC_NUM 64331 Primary Key / Unique ID 88 PRVDR_CTRL_TYPE_CD "13" 89 PRVDR_NUM "660001" 90 RPT_STUS_CD "4" 91 INITL_RPT_SW "Y" 92 LAST_RPT_SW "Y" 93 TRNSMTL_NUM "8" 94 FI_NUM "77002" 95 ADR_VNDR_CD "4" 96 UTIL_CD "F" 97 SPEC_IND "Y" 98 ; 99 LENGTH 100 rpt_rec_num 5 prvdr_ctrl_type_cd 3 prvdr_num $7 101 rpt_stus_cd 3 initl_rpt_sw $1 last_rpt_sw $1 102 trnsmtl_num $1 fi_num $5 adr_vndr_cd 3 util_cd $1 spec_ind $1 103 default = 4; 104 * '2C' is hexadecimal for decimal 44 which represents ',' ; 105 * '0D' is hexadecimal for decimal 13 which represents '\r', which is the carriage return character; 106 infile datafile dsd delimiter='2C0D'x ; 107 ** the ":" is a format modifier that reads data values 108 that need additional instructions from an informat; 109 INPUT 110 rpt_rec_num 111 prvdr_ctrl_type_cd 112 prvdr_num $ 113 npi $ 114 rpt_stus_cd 115 fy_bgn_dt : mmddyy10. 116 fy_end_dt : mmddyy10. 117 proc_dt : mmddyy10. 118 initl_rpt_sw $ 119 last_rpt_sw $ 120 trnsmtl_num $ 121 fi_num $ 122 adr_vndr_cd 123 fi_creat_dt : mmddyy10. 124 util_cd $ 125 npr_dt : mmddyy10. 4 The SAS System 17:21 Monday, April 15, 2019 126 spec_ind $ 127 fi_rcpt_dt : mmddyy10. 128 ; 129 LABEL 130 rpt_rec_num="Report Record Number" 131 prvdr_ctrl_type_cd ="Provider Control Type Code" 132 prvdr_num ="Provider Number" 133 npi="National Provider Identifier" 134 rpt_stus_cd="Report Status Code" 135 fy_bgn_dt="Fiscal Year Begin Date" 136 fy_end_dt="Fiscal Year End Date" 137 proc_dt ="HCRIS Process Date" 138 initl_rpt_sw="Initial Report Switch" 139 last_rpt_sw="Last Report Switch" 140 trnsmtl_num="Transmittal Number" 141 fi_num ="Fiscal Intermediary Number" 142 adr_vndr_cd="Automated Desk Review Vendor Code" 143 fi_creat_dt="Fiscal Intermediary Create Date" 144 util_cd ="Utilization Code" 145 npr_dt ="Notice of Program Reimbursement Date" 146 spec_ind="Special Indicator" 147 fi_rcpt_dt="Fiscal Intermediary Receipt Date" 148 fy="Fiscal year (NBER-computed from fy_bgn_dt)" 149 ; 150 FORMAT 151 fy_bgn_dt MMDDYYS10. 152 fy_end_dt MMDDYYS10. 153 proc_dt MMDDYYS10. 154 fi_creat_dt MMDDYYS10. 155 npr_dt MMDDYYS10. 156 fi_rcpt_dt MMDDYYS10. 157 ; 158 proc sort data=&dataset.; 159 by rpt_rec_num; 160 161 proc means DATA=&dataset. max n; 162 title "Inspect maximums: Using a length of 4 bytes (default) retains 6 significant digits" ; 163 proc freq DATA=&dataset. ; 164 title "" ; 165 tables prvdr_ctrl_type_cd rpt_stus_cd initl_rpt_sw last_rpt_sw trnsmtl_num fi_num adr_vndr_cd util_cd spec_ind ; 166 167 FORMAT 168 prvdr_ctrl_type_cd prvdr_ctrl_type_cd. 169 rpt_stus_cd rpt_stus_cd. 170 initl_rpt_sw $initl_rpt_sw. 171 last_rpt_sw $last_rpt_sw. 172 adr_vndr_cd adr_vndr_cd. 173 util_cd $util_cd. 174 ; 175 proc print DATA=&dataset. (obs=6); 176 proc contents DATA=&dataset.; 177 178 %end; 179 %mend; 180 %loop(FYEAR=1995,LYEAR=2011); MLOGIC(LOOP): Beginning execution. MLOGIC(LOOP): Parameter FYEAR has value 1995 MLOGIC(LOOP): Parameter LYEAR has value 2011 5 The SAS System 17:21 Monday, April 15, 2019 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. NOTE: The data set LIBRARY.FHOSP_RPT has 27 observations and 21 variables. NOTE: PROCEDURE FORMAT used (Total process time): real time 0.27 seconds cpu time 0.01 seconds SYMBOLGEN: Macro variable YEAR resolves to 1995 MPRINT(LOOP): proc printto log ="/homes/data/hcris/2552-96/read_hosp_rpt1995.log" new; NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414 NOTE: The SAS System used: real time 2.77 seconds cpu time 1.03 seconds