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