SAS User File for H248C Data                                                                   
                                                                                                    
This file contains information and sample SAS programs to create a permanent                        
SAS dataset for users who want to use SAS in processing the MEPS data                               
provided in this PUF release.                                                                       
                                                                                                    
There are two ways to create a permanent SAS dataset, using either the SAS                          
transport data file (H248C.SSP) or the ASCII data file (H248C.DAT)                        
supplied in this PUF release. Section A provides a sample SAS program for the                       
first alternative, which is to convert the SAS transport data file to a                             
regular SAS dataset using the SAS procedure: CIMPORT. Section B provides a                          
sample SAS program for the second alternative, which is to read data from the                       
ASCII data file using a SAS DATA step with INFILE, INPUT, and LABEL                                 
statements. Section C explains format-related SAS statements that a user may                        
optionally use when working with the SAS dataset. Examples of SAS programs                          
(DATA step or PROC) are provided in all three sections, primarily for the                           
benefit of inexperienced users. Section D contains complete SAS statements                          
that must be used in the programs described in Sections B and C.                                    
                                                                                                    
******************************************************************************                      
                                                                                                    
The sample SAS programs provided in Sections A and B show how to create a                           
permanent SAS dataset from the data files provided in this PUF release.                             
                                                                                                    
A. A Sample SAS Program for Converting the SAS Transport File to a                                  
Permanent SAS Dataset                                                                               
                                                                                                    
The SAS procedure CIMPORT will read a SAS transport file and convert the                            
data to regular SAS format, storing the output in a permanent SAS dataset.                          
This permanent SAS dataset can then be used for all future processing and                           
analyses.                                                                                           
                                                                                                    
Below is a sample SAS program that can be used to convert the SAS transport                         
file to a permanent SAS dataset (in a Windows environment).                                         
                                                                                                    
     LIBNAME PUFLIB 'C:\MEPS\SASDATA';                                                              
     FILENAME IN1 'C:\MEPS\DOWNLOAD\H248C.SSP';                                                
                                                                                                    
     PROC CIMPORT DATA=PUFLIB.H248C INFILE=IN1;                                                
     RUN;                                                                                           
                                                                                                    
                                                                                                    
Below are SAS statements to print a list of variables and a few sample records                      
from the permanent SAS dataset:                                                                     
                                                                                                    
     PROC CONTENTS DATA=PUFLIB.H248C;                                                          
     TITLE 'List of Variables in MEPS H248C SAS Dataset';                                      
     RUN;                                                                                           
                                                                                                    
     PROC PRINT DATA=PUFLIB.H248C (OBS=20);                                                    
     TITLE 'First 20 Observations in MEPS H248C SAS Dataset';                                  
     RUN;                                                                                           
                                                                                                    
The LIBNAME statement tells SAS the location (directory name) to store the                          
permanent SAS dataset which is output by PROC CIMPORT.  The FILENAME statement                      
tells SAS the location (complete directory and file name) of the input SAS                          
transport data file.                                                                                
                                                                                                    
NOTES:                                                                                              
                                                                                                    
     1)  The names used in the LIBNAME and FILENAME statements shown                                
     above (i.e., PUFLIB, IN1) are arbitrary; they are only temporary                               
     aliases.                                                                                       
                                                                                                    
     2)  The directory and file names used in the LIBNAME and FILENAME                              
     statements shown above are Windows syntax and may need to be                                   
     modified for other operating systems such as UNIX and Linux.                                   
                                                                                                    
     3)  H248C is the internal SAS dataset name (also the PC file name,                        
     without the extension) prior to the creation of the SAS transport data                         
     file.  After running PROC CIMPORT, the output SAS dataset assumes the same                     
     dataset name (or file name).  Hence, in the example above, a file named                        
     H248C.SAS7BDAT will be created under the C:\MEPS\SASDATA directory when                   
     PROC CIMPORT runs successfully.                                                                
                                                                                                    
     4)  The SAS transport file H248C.SSP was created from a SAS V9                            
     data file, using PROC CPORT.  This file should work with earlier versions of                   
     SAS, although it has not been tested with those versions. Users who are                        
     unable to use this SAS transport file should instead convert the ASCII                         
     data file H248C.DAT to a SAS dataset as described in Section B.                           
                                                                                                    
                                                                                                    
B.     A Sample SAS Program for Converting the ASCII Data File to a Permanent                       
SAS Dataset                                                                                         
                                                                                                    
The complete SAS statements (INPUT and LABEL) included in Section D are                             
intended to save time for those users wishing to create a permanent SAS                             
dataset from the H248C.DAT ASCII data file.  These statements must be used                     
in combination with other SAS statements to create the appropriate SAS                              
program, as shown below.  To use the statements provided in Section D to                            
create a SAS program, you will need an ASCII text editor.  If you are using an                      
interactive form of SAS (Windows, UNIX, Linux, etc.), use the editor provided as                    
part of the SAS software.                                                                           
                                                                                                    
Following is a sample Windows SAS program that will convert the ASCII data file to SAS              
format:                                                                                             
                                                                                                    
     LIBNAME PUFLIB 'C:\MEPS\SASDATA';                                                              
     FILENAME IN1 'C:\MEPS\DOWNLOAD\H248C.DAT';                                                
                                                                                                    
     DATA PUFLIB.H248C;                                                                        
     INFILE IN1 LRECL=152;                                                                     
     INPUT .....; * to user: insert the complete INPUT statement that is                            
provided in Section D;                                                                              
     LABEL .....; * to user: insert the complete LABEL statement that is                            
provided in Section D;                                                                              
     RUN;                                                                                           
                                                                                                    
Here is an explanation of the SAS statements used in the program above.                             
                                                                                                    
LIBNAME statement: This tells SAS the location (directory name) of the                              
permanent SAS dataset.                                                                              
                                                                                                    
FILENAME statement: This tells SAS the location of the input ASCII data file.                       
                                                                                                    
DATA statement: This signifies the beginning of a SAS DATA step and specifies                       
the output SAS dataset, referencing the LIBNAME entry (PUFLIB) and assigning                        
an internal SAS dataset name (H248C).  In the example, after the successful                    
completion of the DATA step, a PC file named H248C.SAS7BDAT would have                         
been created in the C:\MEPS\SASDATA directory.                                                      
                                                                                                    
INFILE statement: This tells SAS the location (directory and file name) of the                      
input ASCII data file.  Also provided is the logical record length (152                        
bytes), with the default of RECFM=V implied when this parameter is omitted.                         
LRECL and RECFM are optional parameters in the INFILE statement.  With regard                       
to these options, please note the following: the ASCII data file H248C.DAT                     
contains a 2-byte carriage return/line feed at the end of each record.  When                        
converting to a PC-SAS file, the LRECL option should be used to specify the                         
record length to avoid use of a default record length by PC-SAS.  If the                            
RECFM=V option is used, the LRECL option must be specified as the logical                           
record length (e.g., 152 for H248C.DAT).  If RECFM=F is used, then the                    
LRECL value must  be specified as the logical record length plus 2 (154 for            
H248C.DAT).  Note that if the RECFM option is omitted, then the default                        
option of RECFM=V is automatically used, and LRECL should be specified as the                       
logical record (152 for H248C.DAT).                                                       
                                                                                                    
INPUT statement: This specifies the input record layout, giving names, the                          
beginning column positions, and the lengths for data items (which become SAS                        
variables) in the ASCII data file (H248C.DAT).  Variable type (numeric or                      
character) is also defined by character variables having a dollar sign ($) directly                 
before the variables length, while numeric variables do not have a dollar sign.                     
                                                                                                    
LABEL statement: This associates descriptive names with the SAS variables.                          
                                                                                                    
RUN statement: This tells SAS to execute all commands up to this point.                             
                                                                                                    
                                                                                                    
C.     Optional Format-related SAS Statements                                                       
                                                                                                    
If a user wants to use formats for the SAS variables, a SAS format                                  
catalog must first be created.  Below is a SAS program that will accomplish this:                   
                                                                                                    
     LIBNAME PUFLIB 'C:\MEPS\SASDATA';                                                              
                                                                                                    
     PROC FORMAT LIBRARY=PUFLIB;                                                                    
     VALUE .....; * to user: insert the complete set of VALUE statements found                      
in Section D;                                                                                       
     VALUE .....;                                                                                   
     .......... ;                                                                                   
     RUN;                                                                                           
                                                                                                    
                                                                                                    
Below is an example of how to use the SAS formats defined by the PROC FORMAT                        
procedure:                                                                                          
                                                                                                    
     LIBNAME PUFLIB 'C:\MEPS\SASDATA';                                                              
     OPTIONS FMTSEARCH=(PUFLIB);                                                                    
                                                                                                    
     PROC FREQ DATA=PUFLIB.H248C;                                                              
     TABLES .... / LIST MISSING;                                                                    
     FORMAT varnam1 fmtnam1.  Varnam2 fmtnam2.  .... ;                                              
     * to user: substitute varnam1 and fmtnam1 with actual variable names and                       
format names;                                                                                       
     *     Insert the FORMAT statement provided in Section D, if you are using                      
all the variables in the TABLES statement;                                                          
     TITLE 'Frequency Distributions ....';                                                          
     RUN;                                                                                           
                                                                                                    
Here is an explanation of the SAS statements used above.                                            
                                                                                                    
LIBNAME statement: This tells SAS the location (directory name) of the SAS                          
format library.  Please note that SAS datasets (file name extension is                              
'SAS7BDAT') and format                                                                              
catalog (file name extension is 'SAS7BCAT') can be stored under the same directory.                 
                                                                                                    
OPTIONS FMTSEARCH=...: This specifies the SAS format library.                                       
                                                                                                    
PROC FORMAT statement: This identifies the SAS procedure that will make SAS                         
formats according to VALUE statements.  Formats will be stored in a file named                      
FORMATS.SAS7BCAT.  Please note that the option 'LIBRARY=...' can be omitted                         
if the user does not want to create a permanent SAS format library. When simply                     
'PROC FORMAT;' is used, the formats are defined only for the duration of the                        
batch SAS program or an interactive SAS session.                                                    
                                                                                                    
VALUE statement: This gives a) names to formats; and b) descriptive labels for                      
individual values, or range of values.  The format names can then be invoked                        
using a FORMAT statement if desired.                                                                
                                                                                                    
PROC FREQ statement: This identifies the SAS procedure that generates                               
frequency distributions of variables specified in the TABLES statement,                             
formatted if a FORMAT statement is used.  The input SAS dataset is specified                        
in the 'DATA=' option.                                                                              
                                                                                                    
FORMAT statement: This associates existing formats with variables.  When using                      
this statement, the formats must have already been created with a PROC FORMAT                       
procedure.                                                                                          
                                                                                                    
RUN statement: This tells SAS to execute all commands up to this point.                             
                                                                                                    
                                                                                                    
NOTES:                                                                                              
                                                                                                    
     1)  Use of formats is entirely optional, and depends on the types                              
     of analyses that you are doing.  It is recommended that you create                             
     and use them as appropriate.                                                                   
                                                                                                    
     2)  The names used in the LIBNAME and FILENAME statements shown                                
     above (i.e., PUFLIB, IN1) are arbitrary; they are only temporary                               
     aliases.                                                                                       
                                                                                                    
     3)  The file and directory specifications in the LIBNAME and                                   
     FILENAME statements are Windows syntax and may need to be modified                             
     for other operating systems such as UNIX and Linux.                                            
                                                                                                    
                                                                                                    
D.  SAS Statements                                                                                  
                                                                                                    
This section contains SAS INPUT, LABEL, FORMAT, and VALUE statements for use in                     
converting the ASCII H248C.DAT file into a SAS dataset, and for creating                       
SAS formats.                                                                                        
                                                                                                    
* INPUT STATEMENTS;
INFILE IN LRECL=152;

INPUT @1      DUID                              7.0
      @8      PID                               3.0
      @11     DUPERSID                         $10.0
      @21     EVNTIDX                          $16.0
      @37     EVENTRN                           1.0
      @38     PANEL                             2.0
      @40     OMTYPE_M18                        1.0
      @41     OMSF23X                           8.2
      @49     OMMR23X                           8.2
      @57     OMMD23X                           8.2
      @65     OMPV23X                           8.2
      @73     OMVA23X                           8.2
      @81     OMTR23X                           7.2
      @88     OMOF23X                           7.2
      @95     OMSL23X                           8.2
      @103    OMWC23X                           7.2
      @110    OMOT23X                           7.2
      @117    OMXP23X                           8.2
      @125    OMTC23X                           9.2
      @134    IMPFLAG                           1.0
      @135    PERWT23F                          13.6
      @148    VARSTR                            4.0
      @152    VARPSU                            1.0
;


* FORMAT STATEMENTS;
FORMAT DUID                              DUIDF.
       PID                               PIDF.
       DUPERSID                          $DUPERSIDF.
       EVNTIDX                           $EVNTIDXF.
       EVENTRN                           EVENTRNF.
       PANEL                             PANELF.
       OMTYPE_M18                        OMTYPE_M18F.
       OMSF23X                           OMSF23XF.
       OMMR23X                           OMMR23XF.
       OMMD23X                           OMMD23XF.
       OMPV23X                           OMPV23XF.
       OMVA23X                           OMVA23XF.
       OMTR23X                           OMTR23XF.
       OMOF23X                           OMOF23XF.
       OMSL23X                           OMSL23XF.
       OMWC23X                           OMWC23XF.
       OMOT23X                           OMOT23XF.
       OMXP23X                           OMXP23XF.
       OMTC23X                           OMTC23XF.
       IMPFLAG                           IMPFLAGF.
       PERWT23F                          PERWT23FF.
       VARSTR                            VARSTRF.
       VARPSU                            VARPSUF.
;


* LABEL STATEMENTS;
LABEL DUID                             ="PANEL # + ENCRYPTED DU IDENTIFIER"
      PID                              ="PERSON NUMBER"
      DUPERSID                         ="PERSON ID (DUID + PID)"
      EVNTIDX                          ="EVENT ID"
      EVENTRN                          ="EVENT ROUND NUMBER"
      PANEL                            ="PANEL NUMBER"
      OMTYPE_M18                       ="OTHER MEDICAL EXPENSE TYPE"
      OMSF23X                          ="AMOUNT PAID, FAMILY (IMPUTED)"
      OMMR23X                          ="AMOUNT PAID, MEDICARE (IMPUTED)"
      OMMD23X                          ="AMOUNT PAID, MEDICAID (IMPUTED)"
      OMPV23X                          ="AMOUNT PAID, PRIVATE INSURANCE (IMPUTED)"
      OMVA23X                          ="AMOUNT PAID, VETERANS/CHAMPVA (IMPUTED)"
      OMTR23X                          ="AMOUNT PAID, TRICARE (IMPUTED)"
      OMOF23X                          ="AMOUNT PAID, OTHER FEDERAL (IMPUTED)"
      OMSL23X                          ="AMOUNT PAID, STATE & LOCAL GOV (IMPUTED)"
      OMWC23X                          ="AMOUNT PAID, WORKERS COMP (IMPUTED)"
      OMOT23X                          ="AMOUNT PAID, OTHER INSURANCE (IMPUTED)"
      OMXP23X                          ="SUM OF OMSF23X - OMOT23X (IMPUTED)"
      OMTC23X                          ="HHLD REPORTED TOTAL CHARGE (IMPUTED)"
      IMPFLAG                          ="IMPUTATION STATUS"
      PERWT23F                         ="EXPENDITURE FILE PERSON WEIGHT, 2023"
      VARSTR                           ="VARIANCE ESTIMATION STRATUM, 2023"
      VARPSU                           ="VARIANCE ESTIMATION PSU, 2023"
;


* VALUE STATEMENTS;
VALUE DUIDF  
  2790002 - 2819793 = "VALID ID"
  ;
VALUE $DUPERSIDF  
  '2790002102' - '2819793102' = "VALID ID"
  ;
VALUE EVENTRNF  
  1 = "1 ROUND 1"
  2 = "2 ROUND 2"
  3 = "3 ROUND 3"
  4 = "4 ROUND 4"
  5 = "5 ROUND 5"
  ;
VALUE $EVNTIDXF  
  '2790002102300102' - '2819793102200102' = "VALID ID"
  ;
VALUE IMPFLAGF  
  0 = "0 NOT ELIGIBLE FOR IMPUTATION"
  1 = "1 COMPLETE HC DATA"
  2 = "2 COMPLETE MPC DATA"
  3 = "3 FULLY IMPUTED"
  4 = "4 PARTIALLY IMPUTED"
  5 = "5 CAPITATION IMPUTATION"
  ;
VALUE OMMD23XF  
  0 = "0"
  1 - 49.83 = "$1.00 - $49.83"
  49.84 - 246 = "$49.84 - $246.00"
  246.01 - 817.76 = "$246.01 - $817.76"
  817.77 - 43559.18 = "$817.77 - $43,559.18"
  ;
VALUE OMMR23XF  
  0 = "0"
  1.37 - 85 = "$1.37 - $85.00"
  85.01 - 232.37 = "$85.01 - $232.37"
  232.38 - 500 = "$232.38 - $500.00"
  500.01 - 39840.71 = "$500.01 - $39,840.71"
  ;
VALUE OMOF23XF  
  0 = "0"
  18.75 - 56.3 = "$18.75 - $56.30"
  56.31 - 168.98 = "$56.31 - $168.98"
  168.99 - 543.24 = "$168.99 - $543.24"
  543.25 - 1954.45 = "$543.25 - $1,954.45"
  ;
VALUE OMOT23XF  
  0 = "0"
  9.5 - 37.43 = "$9.50 - $37.43"
  37.44 - 74.5 = "$37.44 - $74.50"
  74.51 - 993 = "$74.51 - $993.00"
  993.01 - 4500 = "$993.01 - $4,500.00"
  ;
VALUE OMPV23XF  
  0 = "0"
  1 - 72 = "$1.00 - $72.00"
  72.01 - 199.86 = "$72.01 - $199.86"
  199.87 - 601.37 = "$199.87 - $601.37"
  601.38 - 53120.95 = "$601.38 - $53,120.95"
  ;
VALUE OMSF23XF  
  0 = "0"
  0.11 - 20.5 = "$0.11 - $20.50"
  20.51 - 75 = "$20.51 - $75.00"
  75.01 - 271 = "$75.01 - $271.00"
  271.01 - 70275.52 = "$271.01 - $70,275.52"
  ;
VALUE OMSL23XF  
  0 = "0"
  319.73 - 400.91 = "$319.73 - $400.91"
  400.92 - 1600 = "$400.92 - $1,600.00"
  1600.01 - 11960 = "$1,600.01 - $11,960.00"
  11960.01 - 53120.95 = "$11,960.01 - $53,120.95"
  ;
VALUE OMTC23XF  
  0 = "0"
  18.44 - 64.15 = "$18.44 - $64.15"
  64.16 - 300 = "$64.16 - $300.00"
  300.01 - 1000 = "$300.01 - $1,000.00"
  1000.01 - 120874.62 = "$1,000.01 - $120,874.62"
  ;
VALUE OMTR23XF  
  0 = "0"
  5 - 34.88 = "$5.00 - $34.88"
  34.89 - 122.26 = "$34.89 - $122.26"
  122.27 - 387.8 = "$122.27 - $387.80"
  387.81 - 2405.48 = "$387.81 - $2,405.48"
  ;
VALUE OMTYPE_M18F  
  -8 = "-8 DON'T KNOW"
  -7 = "-7 REFUSED"
  -1 = "-1 INAPPLICABLE"
  1 = "1 GLASSES OR CONTACT LENSES"
  2 = "2 AMBULANCE SERVICES"
  3 = "3 DISPOSABLE SUPPLIES"
  4 = "4 LONG TERM MEDICAL EQUIPMENT"
  ;
VALUE OMVA23XF  
  0 = "0"
  9.5 - 57.93 = "$9.50 - $57.93"
  57.94 - 200.46 = "$57.94 - $200.46"
  200.47 - 650 = "$200.47 - $650.00"
  650.01 - 10022.82 = "$650.01 - $10,022.82"
  ;
VALUE OMWC23XF  
  0 = "0"
  40.09 - 907.07 = "$40.09 - $907.07"
  907.08 - 1375.5 = "$907.08 - $1,375.50"
  1375.51 - 1580 = "$1,375.51 - $1,580.00"
  1580.01 - 3507.99 = "$1,580.01 - $3,507.99"
  ;
VALUE OMXP23XF  
  0 = "0"
  8.68 - 65 = "$8.68 - $65.00"
  65.01 - 250 = "$65.01 - $250.00"
  250.01 - 672 = "$250.01 - $672.00"
  672.01 - 83599.52 = "$672.01 - $83,599.52"
  ;
VALUE PANELF  
  27 = "27 PANEL 27"
  28 = "28 PANEL 28"
  ;
VALUE PERWT23FF  
  0 = "0.000000"
  501.804727 - 121191.87835 = "501.804727 - 121191.878350"
  ;
VALUE PIDF  
  101 - 304 = "VALID ID"
  ;
VALUE VARPSUF  
  1 - 6 = "1 - 6"
  ;
VALUE VARSTRF  
  2001 - 2117 = "2001 - 2117"
  ;