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-040: Appendix 1 | << previous page


Appendix 1: Sample SAS Program


Copyright (c) 1999-2001 by SAS Institute Inc., Cary, NC,USA.
NOTE: SAS (r) Proprietary Software Release 8.2 (TS2M0)

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 FY 1999 JOBS file when
8   *                  a Round 3 current main job in the FY 2000 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  jobs00   'c:\mydata\jobs00';

NOTE: Libref JOBS00 was successfully assigned as follows:
      Engine:        V8
      Physical Name: c:\mydata\jobs00

17            libname  jobs99   'c:\mydata\jobs99';

NOTE: Libref JOBS99 was successfully assigned as follows:
      Engine:        V6
      Physical Name: c:\mydata\jobs99

18
19
20     /*  Select continuing Panel 4 Round 3 Current Main JOBS       */
21     /*  (SUBTYPE=1, STILLAT=1) from the FY 2000 JOBS file and     */
22     /*  print selected variables from the first 20observations    */
23
24            data j00r3;
25               set jobs00.hc40;
26               if  panel=4
27               and rn=3
28               and subtype=1
29               and stillat=1
30               and sickpay=-1;
31            run;

NOTE: The data set WORK.J00R3 has 5299 observations and 88variables.
NOTE: DATA statement used:    real time           0.92 seconds

32
33            proc print data=j00r3 (obs=20);
34               title 'Print Sample of Continuation Round 3Records';
35                   var dupersid rn jobsn subtype stillatsickpay;
36            run;

Note: There were 20 observations read from the data setWORK.J00R3.
NOTE: PROCEDURE PRINT used:
      real time           0.32 seconds

37
38
39       /*  Select newly reported Panel 4 JOBS records from theFY 1999 */
40       /*  JOBS file and print selected variables from the first 20    */
41       /*  observations.                                              */
42 
43       data j9912;
44                 set jobs99.h32;
45                 if      subtype=1
46                 and     stillat=-1
47                 and     panel=4
48                 and     rn in (1,2);
49            run;

NOTE: The data set WORK.J9912 has 7579 observations and 88variables.
NOTE: DATA statement used:
      real time           0.76 seconds

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

NOTE: There were 20 observations read from the data setWORK.J9912.
NOTE: PROCEDURE PRINT used:
      real time           0.00 seconds

55
56            proc freq data=j9912;
57              tables sickpay/list missing;
58              title 'Sickpay Value of FY 1999 Round 1 And 2Newly Reported CMJs';
59            run;

NOTE: There were 7579 observations read from the data setWORK.J9912.
NOTE: PROCEDURE FREQ used:
      real time           0.31 seconds

60
61
62    /*  Prepare FY99 and FY00 data for merge                         */
63
64            proc sort data=j00r3;
65                 by dupersid jobsn;
66            run;

NOTE: There were 5299 observations read from the data setWORK.J00R3.
NOTE: The data set WORK.J00R3 has 5299 observations and 88variables.
NOTE: PROCEDURE SORT used:
      real time           0.10seconds

67
68            proc sort data=j9912;
69                 by dupersid jobsn;
70            run;

NOTE: The data set WORK.J9912 has 7579 observations and 88variables.
NOTE: PROCEDURE SORT used:    real time           0.16 seconds

71
72
73
74   /*  Create a dataset (J00R3F) that includes all variables       */
75   /*  for the continuation Round 3 JOBS and create the new        */
76   /*  variable SICKPAYX by copying SICKPAY from thecorresponding  */
77   /*  Round 1 or Round 2 newly reported job record.               */
78
79          data j00r3f;
80               merge j00r3 (in=a) j9912 (in=b  keep = dupersidjobsn sickpay
81                                           rename=(sickpay=sickpayx));
82               by dupersid jobsn;
83               if a and b;
84          run;

NOTE: There were 7579 observations read from the data setWORK.J9912.
NOTE: The data set WORK.J00R3F has 5292 observations and 89variables.
NOTE: DATA statement used:
      real time           0.32 seconds

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

NOTE: PROCEDURE FREQ used:
      real time           0.06 seconds



                 Print Sample Of Continuation Round 3 Records   14:30 Wednesday, August 28, 2002

 Obs    DUPERSID    RN    JOBSN    SUBTYPE    STILLAT    SICKPAY

  1     72748010     3      2          1          1         -1
  2     70671014     3      3          1          1         -1
  3     70052016     3      1          1          1         -1
  4     74560020     3      1          1          1         -1
  5     74560037     3      1          1          1         -1
  6     75058017     3      1          1          1         -1
  7     76540010     3      1          1          1         -1
  8     75752014     3      1          1          1         -1
  9     75752021     3      1          1          1         -1
 10     76686018     3      1          1          1         -1
 11     76686025     3      1          1          1         -1
 12     70373024     3      1          1          1         -1
 13     72407014     3      1          1          1         -1
 14     72407021     3      1          1          1         -1
 15     70356011     3      1          1          1         -1
 16     74156025     3      1          1          1         -1
 17     73040015     3      1          1          1         -1
 18     72181010     3      1          1          1         -1
 19     72273017     3      1          1          1         -1
 20     72869014     3      1          1          1         -1



       Print Sample Of Newly Reported Round 1 and Round 2 Records   14:30 Wednesday, August 28, 2002

 Obs    DUPERSID    RN    JOBSN    SUBTYPE    STILLAT    SICKPAY

  1    70778013     1      1          1         -1          1
  2    72748010     1      1          1         -1          1
  3    72748010     2      2          1         -1          1
  4    70671014     1      1          1         -1          1
  5    70671014     2      3          1         -1          2
  6    70052016     1      1          1         -1          1
  7    74560013     1      1          1         -1          1
  8    74560020     1      1          1         -1          1
  9    74560037     1      1          1         -1          2
 10    75058017     1      1          1         -1          1
 11    76540010     1      1          1         -1          2
 12    75752014     1      1          1         -1          2
 13    75752021     1      1          1         -1          1
 14    76686018     1      1          1         -1          1
 15    76686025     1      1          1         -1          1
 16    76686032     1      1          1         -1          1
 17    76686032     2      2          1         -1          2
 18    70373024     1      1          1         -1          1
 19    72407014     1      1          1         -1         -1
 20    72407021     1      1          1         -1          1



       Sickpay Value Of FY1999 Round 1 And 2 Newly Reported CMJs     14:30 Wednesday, August 28, 2002

                           The FREQ Procedure

                    DOES PERSON HAVE PAID SICK LEAVE

                                     Cumulative    Cumulative
SICKPAY    Frequency     Percent     Frequency      Percent
----------------------------------------------------------------
   -9          11          0.15            11         0.15
   -8         225          2.97           236         3.11
   -7          11          0.15           247         3.26
   -1         884         11.66          1131        14.92
    1        3717         49.04          4848        63.97
    2        2731         36.03          7579       100.00



              Diagnostic Post-Merge - Sickpay * Sickpayx          14:30 Wednesday, August 28, 2002
             Round 3 Continuation Current Main Jobs Only

                        The FREQ Procedure

                                                 Cumulative  Cumulative
SICKPAY    sickpayx    Frequency     Percent     Frequency    Percent
-------------------------------------------------------------------------
   -1          -9           7        0.13             7         0.13
   -1          -8         126        2.38           133         2.51
   -1          -7           8        0.15           141         2.66
   -1          -1         699       13.21           840        15.87
   -1           1        2916       55.10          3756        70.98
   -1           2        1536       29.02          5292       100.00


<< previous page