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