SAS User File for H140 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 (H140.SSP) or the ASCII data file (H140.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: XCOPY. 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. INCLUDED BELOW ARE NOTES APPLICABLE TO USERS OF SAS VERSION 8 OR HIGHER. ****************************************************************************** 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 XCOPY 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, with SAS V8 or higher). LIBNAME PUFLIB 'C:\MEPS\SASDATA'; FILENAME IN1 'C:\MEPS\DOWNLOAD\H140.SSP'; PROC XCOPY IN=IN1 OUT=PUFLIB IMPORT; RUN; SAS transport files, SAS data files, and SAS program files each should be stored in separate locations (directory names). Storing different types of SAS files in one location can cause errors with converting or retrieving data. Below are SAS statements to print a list of variables and a few sample records from the permanent SAS dataset: PROC CONTENTS DATA=PUFLIB.H140; TITLE "List of Variables in MEPS H140 SAS Dataset"; RUN; PROC PRINT DATA=PUFLIB.H140 (OBS=20); TITLE "First 20 Observations in MEPS H140 SAS Dataset"; RUN; The LIBNAME statement tells SAS the location (directory name) to store the permanent SAS dataset which is output by PROC XCOPY. The FILENAME statement tells SAS the location (complete directory and file name) of the input SAS transport data file. NOTES: 1) If you have an error reading a SAS data file you created, the problem may be a result of where you are storing and/or how you are retrieving the data. First check the data library for multiple releases of SAS files (e.g., V8 with file extensions of '.SAS7BDAT' and V6 with file extensions of '.SD2') stored in the same location. a) You can avoid errors when reading these files by including the SAS release within the LIBNAME statement - e.g., LIBNAME PUFLIB V8 'C:\MEPS\SASDATA'; or b) Store SAS data files with different file extensions such as .SD2 and .SAS7BDAT, in separate folders (do not co-mingle V8 and V6 files in the same folder); or c) When importing transport files, output the SAS dataset to a different library than the one which contains the downloaded SAS transport file - e.g., LIBNAME PUFLIB 'C:\MEPS\SASDATA'; FILENAME IN1 'C:\MEPS\DOWNLOAD\Hxx.SSP'; PROC XCOPY IN=IN1 OUT=PUBLIB IMPORT; RUN; 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 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, MAC/OS, VMS, or OS/2. 4) H140 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 XCOPY, the output SAS dataset assumes the same dataset name (or file name). Hence, in the example above, a file named H140.SAS7BDAT will be created under the C:\MEPS\SASDATA directory when PROC XCOPY runs successfully. 5) The SAS transport file H140.SSP was created from a SAS V9 data file, using PROC COPY. This file has been tested for use with SAS V8 or higher. This file may 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 H140.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 H140.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, OS2, etc.), use the editor provided as part of the SAS software. Following is a sample SAS program that will convert the ASCII data file to SAS format: LIBNAME PUFLIB 'C:\MEPS\SASDATA'; FILENAME IN1 'C:\MEPS\DOWNLOAD\H140.DAT'; DATA PUFLIB.H140; INFILE IN1 LRECL=158; 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 (H140). In the example, after the successful completion of the DATA step, a PC file named H140.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 (158 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 H140.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., 158 for H140.DAT). If RECFM=F is used, then the LRECL value must be specified as the logical record length plus 2 (160 for H140.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 (158 for H140.DAT). INPUT statement: This specifies the input record layout, giving names and the beginning and ending column positions for data items (which become SAS variables) in the ASCII data file (H140.DAT). Variable type (numeric or character) is also defined via the INPUT statement. LABEL statement: This associates descriptive names with the SAS variables. RUN statement: This tells SAS to execute all commands up to this point. See Section A.1 above for tips on retrieving and storing the permanent SAS data files. C. Optional Format-related SAS Statements If a user wants to use formats for the SAS variables, a SAS format library 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.H140; 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' for SAS V8 or higher and 'SD2' for SAS V6) and format libraries (file name extension is 'SAS7BCAT' for SAS V8 or higher and 'SC2' for SAS V6) 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) You only create the permanent SAS dataset once. Additional analyses can be run using this permanent dataset. 4) 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, MAC/OS, VMS, or OS/2. D. SAS Statements This section contains SAS INPUT, LABEL, FORMAT, and VALUE statements for use in converting the ASCII H140.DAT file into a SAS dataset, and for creating SAS formats. * INPUT STATEMENTS; INFILE IN LRECL=158; INPUT @1 DUPERSID $8.0 @9 PANEL 2.0 @11 YEARONE 1.0 @12 INSCAT1 2.0 @14 AGESEXPV 2.0 @16 AGESEXMC 2.0 @18 AGESEXMD 2.0 @20 RRSHCCPV 9.6 @29 RRSASPV 9.6 @38 RRSHCCMC 9.6 @47 RRSASMC 9.6 @56 RRSHCCMD 9.6 @65 RRSASMD 9.6 @74 RRSHCCUN 9.6 @83 RRSASUN 9.6 @92 HCCPV 9.6 @101 ASPV 9.6 @110 HCCMC 9.6 @119 ASMC 9.6 @128 HCCMD 9.6 @137 ASMD 9.6 @146 LONGWT 13.6 ; * FORMAT STATEMENTS; FORMAT DUPERSID $ID. PANEL PANEL. YEARONE YEARONE. INSCAT1 INSCAT. AGESEXPV AGESEX. AGESEXMC AGESEX. AGESEXMD AGESEXMD. RRSHCCPV RRSHCCPV. RRSASPV RRSASPV. RRSHCCMC RRSHCCMC. RRSASMC RRSASMC. RRSHCCMD RRSHCCMD. RRSASMD RRSASMD. RRSHCCUN RRSHCCUN. RRSASUN RRSASUN. HCCPV HCCPV. ASPV ASPV. HCCMC HCCMC. ASMC ASMC. HCCMD HCCMD. ASMD ASMD. LONGWT LONGWT. ; * LABEL STATEMENTS; LABEL DUPERSID='PERSON ID (DUID + PID)' PANEL ='PANEL FLAG' YEARONE ='INDICATOR IF RECORD HAS YEAR ONE DATA' INSCAT1 ='YR 1: TYPE OF INSURANCE COVERAGE' AGESEXPV='DXCG AGESEX COMBINED GROUP, PRIVATE' AGESEXMC='DXCG AGESEX COMBINED GROUP, MCARE' AGESEXMD='DXCG AGESEX COMBINED GROUP, MCAID, 0-64' RRSHCCPV='RELATIVE RISK SCORES, HCC, PRIVATE' RRSASPV ='RELATIVE RISK SCORES, AGESEX, PRIVATE' RRSHCCMC='RELATIVE RISK SCORES, HCC, MCARE' RRSASMC ='RELATIVE RISK SCORES, AGESEX, MCARE' RRSHCCMD='RELATIVE RISK SCORES, HCC, MCAID, 0-64' RRSASMD ='RELATIVE RISK SCORES, AGESEX, MCAID,0-64' RRSHCCUN='RELATIVE RISK SCORES,HCC,PRIV,NORM UNINS' RRSASUN ='RELT RISK SCORES, AGESEX,PRIV,NORM UNINS' HCCPV ='NOT NRMLZD RISK SCORES, HCC, PRIV&UNINS' ASPV ='NOT NRMLZD RISK SCORES,AGESEX,PRIV&UNINS' HCCMC ='NOT NRMLZD RISK SCORES, HCC, MCARE' ASMC ='NOT NRMLZD RISK SCORES, AGESEX, MCARE' HCCMD ='NOT NRMLZD RISK SCORES, HCC, MCAID, 0-64' ASMD ='NOT NRMLZD RISK SCORES,AGESEX,MCAID,0-64' LONGWT ='LONGITUDINAL WEIGHT' ; * VALUE STATEMENTS; VALUE AGESEX -9 = '-9 RECORD DOES NOT HAVE YEAR ONE DATA' 1 = '1 FEMALE AGE 0-1' 2 = '2 FEMALE AGE 2-5' 3 = '3 FEMALE AGE 6-12' 4 = '4 FEMALE AGE 13-17' 5 = '5 FEMALE AGE 18-24' 6 = '6 FEMALE AGE 25-34' 7 = '7 FEMALE AGE 35-44' 8 = '8 FEMALE AGE 45-54' 9 = '9 FEMALE AGE 55-59' 10 = '10 FEMALE AGE 60-64' 11 = '11 FEMALE AGE 65-69' 12 = '12 FEMALE AGE 70-74' 13 = '13 FEMALE AGE 75-79' 14 = '14 FEMALE AGE 80-84' 15 = '15 FEMALE AGE 85+' 18 = '18 MALE AGE 0-1' 19 = '19 MALE AGE 2-5' 20 = '20 MALE AGE 6-12' 21 = '21 MALE AGE 13-17' 22 = '22 MALE AGE 18-24' 23 = '23 MALE AGE 25-34' 24 = '24 MALE AGE 35-44' 25 = '25 MALE AGE 45-54' 26 = '26 MALE AGE 55-59' 27 = '27 MALE AGE 60-64' 28 = '28 MALE AGE 65-69' 29 = '29 MALE AGE 70-74' 30 = '30 MALE AGE 75-79' 31 = '31 MALE AGE 80-84' 32 = '32 MALE AGE 85+' ; VALUE AGESEXMD -9 = '-9 RECORD DOES NOT HAVE YEAR ONE DATA' -1 = '-1 PERSONS AGE 65+' 1 = '1 FEMALE AGE 0-5' 2 = '2 FEMALE AGE 6-12' 3 = '3 FEMALE AGE 13-17' 4 = '4 FEMALE AGE 18-24' 5 = '5 FEMALE AGE 25-34' 6 = '6 FEMALE AGE 35-44' 7 = '7 FEMALE AGE 45-54' 8 = '8 FEMALE AGE 55-59' 9 = '9 FEMALE AGE 60-64' 17 = '17 MALE AGE 0-5' 18 = '18 MALE AGE 6-12' 19 = '19 MALE AGE 13-17' 20 = '20 MALE AGE 18-24' 21 = '21 MALE AGE 25-34' 22 = '22 MALE AGE 35-44' 23 = '23 MALE AGE 45-54' 24 = '24 MALE AGE 55-59' 25 = '25 MALE AGE 60-64' ; VALUE ASMC -9 = '-9 RECORD DOES NOT HAVE YEAR ONE DATA' 0.692 = '0.692' 0.717 = '0.717' 0.756 = '0.756' 0.827 = '0.827' 0.897 = '0.897' 0.916 = '0.916' 0.917 = '0.917' 0.975 = '0.975' 0.991 = '0.991' 1.005 = '1.005' 1.075 = '1.075' 1.106 = '1.106' 1.108 = '1.108' 1.159 = '1.159' 1.207 = '1.207' 1.228 = '1.228' 1.288 = '1.288' 1.29 = '1.290' 1.318 = '1.318' 1.456 = '1.456' ; VALUE ASMD -9 = '-9 RECORD DOES NOT HAVE YEAR ONE DATA' -1 = '-1 PERSONS AGE 65+' 0.105 = '0.105' 0.113 = '0.113' 0.14 = '0.140' 0.15 = '0.150' 0.175 = '0.175' 0.204 = '0.204' 0.408 = '0.408' 0.485 = '0.485' 0.762 = '0.762' 0.869 = '0.869' 0.914 = '0.914' 1.127 = '1.127' 1.137 = '1.137' 1.215 = '1.215' 1.224 = '1.224' 1.354 = '1.354' 1.401 = '1.401' 1.407 = '1.407' ; VALUE ASPV -9 = '-9 RECORD DOES NOT HAVE YEAR ONE DATA' 0.285 = '0.285' 0.326 = '0.326' 0.337 = '0.337' 0.398 = '0.398' 0.399 = '0.399' 0.46 = '0.460' 0.472 = '0.472' 0.49 = '0.490' 0.627 = '0.627' 0.665 = '0.665' 0.712 = '0.712' 0.747 = '0.747' 1.064 = '1.064' 1.117 = '1.117' 1.184 = '1.184' 1.441 = '1.441' 1.77 = '1.770' 1.813 = '1.813' 2.161 = '2.161' 2.209 = '2.209' 2.225 = '2.225' 2.656 = '2.656' 2.759 = '2.759' 3.338 = '3.338' ; VALUE HCCMC -9 = '-9 RECORD DOES NOT HAVE YEAR ONE DATA' -1 = '-1 PERSONS AGE 65+' 0.12 - 8.167 = '0.120 - 8.167' ; VALUE HCCMD -9 = '-9 RECORD DOES NOT HAVE YEAR ONE DATA' -1 = '-1 PERSONS AGE 65+' 0.031 - 8.469 = '0.031 - 8.469' ; VALUE HCCPV -9 = '-9 RECORD DOES NOT HAVE YEAR ONE DATA' -1 = '-1 PERSONS AGE 65+' 0.115 - 31.828 = '0.115 - 31.828' ; VALUE $ID '20002014' - '98356030' = '20002014 - 98356030' ; VALUE INSCAT -9 = '-9 RECORD DOES NOT HAVE YEAR ONE DATA' 1 = '1 MEDICARE' 2 = '2 PRIVATE' 3 = '3 MEDICAID' 4 = '4 UNINSURED' ; VALUE LONGWT 466 - 153297 = '466 - 153,297' ; VALUE PANEL 7 = 'PANEL 7 (2002-2003)' 8 = 'PANEL 8 (2003-2004)' 9 = 'PANEL 9 (2004-2005)' 10 = 'PANEL 10 (2005-2006)' 11 = 'PANEL 11 (2006-2007)' 12 = 'PANEL 12 (2007-2008)' 13 = 'PANEL 13 (2008-2009)' 14 = 'PANEL 14 (2009-2010)' ; VALUE RRSASMC -9 = '-9 RECORD DOES NOT HAVE YEAR ONE DATA' -1 = '-1 PERSONS AGE 65+' 0.686 - 1.469 = '0.686 - 1.469' ; VALUE RRSASMD -9 = '-9 RECORD DOES NOT HAVE YEAR ONE DATA' -1 = '-1 PERSONS AGE 65+' 0.256 - 3.721 = '0.256 - 3.721' ; VALUE RRSASPV -9 = '-9 RECORD DOES NOT HAVE YEAR ONE DATA' -1 = '-1 PERSONS AGE 65+' 0.283 - 3.519 = '0.283 - 3.519' ; VALUE RRSASUN -9 = '-9 RECORD DOES NOT HAVE YEAR ONE DATA' -1 = '-1 PERSONS AGE 65+' 0.307 - 3.9 = '0.307 - 3.900' ; VALUE RRSHCCMC -9 = '-9 RECORD DOES NOT HAVE YEAR ONE DATA' -1 = '-1 PERSONS AGE 65+' 0.188 - 13.846 = '0.188 - 13.846' ; VALUE RRSHCCMD -9 = '-9 RECORD DOES NOT HAVE YEAR ONE DATA' -1 = '-1 PERSONS AGE 65+' 0.083 - 25.425 = '0.083 - 25.425' ; VALUE RRSHCCPV -9 = '-9 RECORD DOES NOT HAVE YEAR ONE DATA' -1 = '-1 PERSONS AGE 65+' 0.127 - 37.08 = '0.127 - 37.080' ; VALUE RRSHCCUN -9 = '-9 RECORD DOES NOT HAVE YEAR ONE DATA' -1 = '-1 PERSONS AGE 65+' 0.151 - 44.732 = '0.151 - 44.732' ; VALUE YEARONE 1 = '1 RECORD HAS YEAR ONE DATA' 2 = '2 RECORD DOES NOT HAVE YEAR ONE DATA' ;