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