Skip to main content
U.S. flag
Health and Human Services Logo

An official website of the Department of Health & Human Services

menu-iconMore mobile-close-icon
mobile-back-btn-icon Back
  • menu-iconMenu
  • mobile-search-icon
AHRQ: Agency for Healthcare Research and Quality
  • Search All AHRQ Sites
  • Careers
  • Contact Us
  • Español
  • FAQs
  • Email Updates
MEPS Home Medical Expenditure Panel Survey
Font Size:
Contact MEPS FAQ Site Map  
S
M
L
XL
MEPS HC-056: Appendix 1 << previous page


Appendix 1: Sample SAS Program

1                                             The SAS System                      16:13
Friday, July 25, 2003

NOTE: Copyright (c) 1999-2001 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) Proprietary Software Release 8.2 (TS2M0)
      Licensed to WESTAT, Site 0009005004.
NOTE: This session is executing on the WIN_98 platform.

NOTE: SAS initialization used:
      real time           1.21 seconds

NOTE: AUTOEXEC processing beginning; file is C:\progra~1\sasins~1\sas\v8\autoexec.sas.

NOTE: AUTOEXEC processing completed.

1                    OPTIONS LS=132 PS=79;
2
3     /************************************************************************/
4     /*    Program Name: SAMPLE.SAS                                          */
5     /*                                                                      */
6     /*    Description:  This job provides an example of how to get job info */
7     /*                  from Round 1 or Round 2 in the FY2000 JOBS file when*/
8     /*                  a Round 3 current main job in the FY2001 JOBS file  */
9     /*                  is a continuation job.                              */
10    /*                                                                      */
11    /*                This example creates a dataset of Round 3 continuation*/
12    /*                JOBS records with a SICKPAYX variable copied from the */
13    /*                Round 1 or Round 2 newly reported job.                */
14    /************************************************************************/
15
16                  libname jobs01 "c:\mydata\jobs01";
NOTE: Libref JOBS01 was successfully assigned as follows:
      Engine:        V8
      Physical Name: c:\mydata\jobs01
17                  libname jobs00 "c:\mydata\jobs00";
NOTE: Libref JOBS00 was successfully assigned as follows:
      Engine:        V8
      Physical Name: c:\mydata\jobs00
18
19            /*  Select continuing Panel 5, Round 3 Current Main JOBS   */
20            /*  (SUBTYPE=1, STILLAT=1) from the FY 2001 JOBS file and  */
21            /*  print selected variables from the first 20 observations*/
22
23                  data j01r3;
24                     set jobs01.h56;
25                            if      panel=5
26                            and     rn=3
27                            and     subtype=1
28                            and     stillat=1
29                            and     sickpay=-1;
30                  run;

NOTE: There were 61265 observations read from the data set JOBS01.H56.
NOTE: The data set WORK.J01R3 has 4162 observations and 83 variables.
NOTE: DATA statement used:
      real time           3.79 seconds
31
32                  proc print data=j01r3 (obs=20);
33                     title 'Print Sample of Continuation Round 3 Records';
34                         var dupersid panel rn jobsn subtype stillat sickpay;
35                  run;

NOTE: There were 20 observations read from the data set WORK.J01R3.
NOTE: The PROCEDURE PRINT printed page 1.
NOTE: PROCEDURE PRINT used:
      real time           0.32 seconds
36
37
38       /* Select newly reported Panel 5 Current Main JOBS records from   */
39       /* the FY 2000 JOBS file and print selected variables from the    */
40       /* first 20 observations.                                         */
41
42                  data j0012;
43                       set jobs00.h40;
44                       if      subtype=1
45                       and     stillat=-1
46                       and     panel=5
47                       and     rn in (1,2);
48                  run;

NOTE: There were 44935 observations read from the data set JOBS00.H40.
NOTE: The data set WORK.J0012 has 5962 observations and 88 variables.
NOTE: DATA statement used:
      real time           2.69 seconds


49
50                  proc print data=j0012 (obs=20);
51                       title 'Print Sample of Newly Reported Round 1 and Round 2 Records';
52                       var dupersid panel rn jobsn subtype stillat sickpay;
53                  run;

NOTE: There were 20 observations read from the data set WORK.J0012.
NOTE: The PROCEDURE PRINT printed page 2.
NOTE: PROCEDURE PRINT used:
      real time           0.00 seconds


54
55                  proc freq data=j0012;
56                       tables sickpay/list missing;
57                       title 'Sickpay Value of FY2000 Round 1 and Round 2 Newly Reported CMJs';
58                  run;

NOTE: There were 5962 observations read from the data set WORK.J0012.
NOTE: The PROCEDURE FREQ printed page 3.
NOTE: PROCEDURE FREQ used:
      real time           0.16 seconds


59
60
61                   /* Prepare FY00 and FY01 data for merge        */
62
63                   proc sort data=j01r3;
64                        by dupersid jobsn;
65                   run;

NOTE: There were 4162 observations read from the data set WORK.J01R3.
NOTE: The data set WORK.J01R3 has 4162 observations and 83 variables.
NOTE: PROCEDURE SORT used:
      real time           0.10 seconds


66
67                   proc sort data=j0012;
68                        by dupersid jobsn;
69                   run;

NOTE: There were 5962 observations read from the data set WORK.J0012.
NOTE: The data set WORK.J0012 has 5962 observations and 88 variables.
NOTE: PROCEDURE SORT used:
      real time           0.11 seconds
70
71
72
73        /* Create a dataset (J01R3F) that includes all variables         */
74        /* for the continuation Round 3 Current Main JOBS and create     */
75        /* the new variable SICKPAYX by copying SICKPAY from the         */
76        /* corresponding Round 1 or Round 2 newly reported job record.   */
77
78                   data j01r3f;
79                        merge j01r3 (in=a) j0012 (in=b keep = dupersid jobsn sickpay
80      rename=(sickpay=SICKPAYX));
81                        by dupersid jobsn;
82                        if a and b;
83                   run;

NOTE: There were 4162 observations read from the data set WORK.J01R3.
NOTE: There were 5962 observations read from the data set WORK.J0012.
NOTE: The data set WORK.J01R3F has 4161 observations and 84 variables.
NOTE: DATA statement used:
      real time           0.22 seconds


84
85                   proc freq data=j01r3f;
86                        tables sickpay*sickpayx/list missing;
87                        title1 'Diagnostic Post-Merge - Sickpay * Sickpayx';
88                        title2 'Round 3 Continuation Current Main Jobs Only';
89                   run;

NOTE: There were 4161 observations read from the data set WORK.J01R3F.
NOTE: The PROCEDURE FREQ printed page 4.
NOTE: PROCEDURE FREQ used:
      real time           0.04 seconds


90
91                    OPTIONS LS=132 PS=79;
92
93  /******************************************************************/

NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
NOTE: The SAS System used:
      real time           9.06 seconds


Print Sample of Continuation Round 3 Records                16:13 Friday, July 25, 2003 1

Obs      DUPERSID     PANEL      RN      JOBSN     SUBTYPE     STILLAT     SICKPAY  
1 80001021 5 3 1 1 1 -1
2 80005018 5 3 1 1 1 -1
3 80005025 5 3 1 1 1 -1
4 80006012 5 3 1 1 1 -1
5 80006029 5 3 1 1 1 -1
6 80007015 5 3 1 1 1 -1
7 80009012 5 3 1 1 1 -1
8 80009029 5 3 1 1 1 -1
9 80010013 5 3 1 1 1 -1
10 80010020 5 3 2 1 1 -1
11 80011014 5 3 1 1 1 -1
12 80012024 5 3 1 1 1 -1
13 80013014 5 3 1 1 1 -1
14 80016014 5 3 1 1 1 -1
15 80016021 5 3 1 1 1 -1
16 80016038 5 3 1 1 1 -1
17 80017015 5 3 1 1 1 -1
18 80017022 5 3 1 1 1 -1
19 80018021 5 3 1 1 1 -1
20 80020016 5 3 1 1 1 -1

 

Print Sample of Newly Reported Round 1 and Round 2 Records    16:13 Friday, July 25, 2003 2

Obs      DUPERSID     PANEL      RN      JOBSN     SUBTYPE     STILLAT     SICKPAY  
1 80793018 5 1 1 1 -1  2
2 82456015 5 1 1 1 -1  2
3 82456022 5 1 1 1 -1  2
4 80900018 5 1 1 1 -1  1
5 82069019 5 1 1 1 -1 -1
6 82069019 5 2 2 1 -1 -8
7 82069035 5 1 1 1 -1 -8
8 85276018 5 1 1 1 -1  2
9 81974022 5 2 1 1 -1 -1
10 81959011 5 1 1 1 -1  1
11 81915015 5 1 1 1 -1  2
12 81915022 5 1 1 1 -1  1
13 84387012 5 1 1 1 -1  1
14 84387029 5 1 1 1 -1  1
15 84387036 5 1 1 1 -1  1
16 84387036 5 2 2 1 -1  2
17 84387043 5 1 1 1 -1 -8
18 84387043 5 2 2 1 -1  1
19 84387059 5 1 1 1 -1  2
20 84387066 5 1 1 1 -1  2

 

Sickpay Value of FY2000 Round 1 and Round 2 Newly Reported CMJs 16:13 Friday,July 25,2003 3

                                       The FREQ Procedure

                                    DOES PERSON HAVE PAID SICK LEAVE

SICKPAY     Frequency     Percent   Cumulative
  Frequency  
Cumulative
   Percent   
-9   13  0.22   13   0.22
-8  145  2.43  158   2.65
-7   16  0.27  174   2.92
-1  660 11.07  834  13.99
1 2880 48.31 3714  62.29
2 2248 37.71 5962 100.00

 

Diagnostic Post-Merge - Sickpay * Sickpayx                     16:13 Friday, July 25, 2003 4

                           Round 3 Continuation Current Main Jobs Only

                                       The FREQ Procedure

SICKPAY     SICKPAYX     Frequency     Percent   Cumulative
  Frequency  
Cumulative
   Percent   
-1 -9    8  0.19    8   0.19
-1 -8   89  2.14   97   2.33
-1 -7    7  0.17  104   2.50
-1 -1  519 12.47  623  14.97
-1  1 2241 53.86 2854  68.83
-1  2 1297 31.17 4161 100.00

<< previous page