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-124: Appendix 1. Sample SAS Program

<< previous page


Table of Contents

1. The SAS System Log
2. The SAS System List

The SAS System

NOTE: Copyright (c) 2002-2008 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) Proprietary Software 9.2 (TS2M3)

1
2
3
4
5 /* APP09.sas */
6
7 OPTIONS LS=132 PS=79;
8
9 /*****************************************************************************/
10 /* Program Name: SAMPLE.SAS */
11 /* */
12 /* Description: This job provides an example of how to get job info */
13 /* from Round 1 or Round 2 in the FY2008 JOBS file when */
14 /* a Round 3 current main job in the FY2009 JOBS file */
15 /* is a continuation job. */
16 /* */
17 /* This example creates a dataset of Round 3 continuation */
18 /* JOBS records with a SICKPAYX variable copied from the */
19 /* Round 1 or Round 2 newly reported job. */
20 /* */
21 /*****************************************************************************/
22
23 libname jobs08 "c:\mydata\jobs08";
24 libname jobs09 "c:\mydata\jobs09";
25
26 /* Select continuing Panel 13, Round 3 Current Main JOBS */
27 /* (SUBTYPE=1, STILLAT=1) from the FY 2009 JOBS file and */
28 /* print selected variables from the first 20 observations */
29
30 data j09r3;
31 set jobs09.jobs09;
32 if panel=13
33 and rn=3
34 and subtype=1
35 and stillat=1
36 and sickpay=-1;
37 run;

NOTE: There were 59454 observations read from the data set JOBS09.JOBS09.
NOTE: The data set WORK.J09R3 has 7036 observations and 87 variables.
NOTE: DATA statement used (Total process time):
real time 3.48 seconds
cpu time 0.18 seconds

38
39 proc print data=j09r3 (obs=20);
40 title 'Print Sample of Continuation Round 3 Records';
41 var dupersid panel rn jobsn subtype stillat sickpay;
42 run;

NOTE: There were 20 observations read from the data set WORK.J09R3.
NOTE: The PROCEDURE PRINT printed page 1.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.06 seconds
cpu time 0.06 seconds

43
44
45 /* Select newly reported Panel 13 Current Main JOBS records from */
46 /* the FY 2008 JOBS file and print selected variables from the */
47 /* first 20 observations. */
48
49 data j0813;
50 set jobs08.jobs08;
51 if subtype=1
52 and stillat=-1
53 and panel=13
54 and rn in (1,2);
55 run;

NOTE: There were 56163 observations read from the data set JOBS08.JOBS08.
NOTE: The data set WORK.J0813 has 9959 observations and 87 variables.
NOTE: DATA statement used (Total process time):
real time 3.26 seconds
cpu time 0.20 seconds

56
57 proc print data=j0813 (obs=20);
58 title 'Print Sample of Newly Reported Round 1 and Round 2 Records';
59 var dupersid panel rn jobsn subtype stillat sickpay;
60 run;

NOTE: There were 20 observations read from the data set WORK.J0813.
NOTE: The PROCEDURE PRINT printed page 2.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

61
62 proc freq data=j0813;
63 tables sickpay/list missing;
64 title 'Sickpay Value of FY2008 Round 1 and Round 2 Newly Reported CMJs';
65 run;

NOTE: There were 9959 observations read from the data set WORK.J0813.
NOTE: The PROCEDURE FREQ printed page 3.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.04 seconds
cpu time 0.01 seconds

66
67
68 /* Prepare FY08 and FY09 data for merge */
69
70 proc sort data=j09r3;
71 by dupersid jobsn;
72 run;

NOTE: There were 7036 observations read from the data set WORK.J09R3.
NOTE: The data set WORK.J09R3 has 7036 observations and 87 variables.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.03 seconds
cpu time 0.01 seconds

73
74 proc sort data=j0813;
75 by dupersid jobsn;
76 run;

NOTE: There were 9959 observations read from the data set WORK.J0813.
NOTE: The data set WORK.J0813 has 9959 observations and 87 variables.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.03 seconds
cpu time 0.03 seconds

77
78
79 /* Create a dataset (J09R3F) that includes all variables */
80 /* for the continuation Round 3 Current Main JOBS and create */
81 /* the new variable SICKPAYX by copying SICKPAY from the */
82 /* corresponding Round 1 or Round 2 newly reported job record. */
83
84 data j09r3f;
85 merge j09r3 (in=a) j0813 (in=b keep = dupersid jobsn sickpay
86 rename=(sickpay=SICKPAYX));
87 by dupersid jobsn;
88 if a and b;
89 run;

NOTE: There were 7036 observations read from the data set WORK.J09R3.
NOTE: There were 9959 observations read from the data set WORK.J0813.
NOTE: The data set WORK.J09R3F has 7035 observations and 88 variables.
NOTE: DATA statement used (Total process time):
real time 0.04 seconds
cpu time 0.03 seconds

90
91 proc freq data=j09r3f;
92 tables sickpay*sickpayx/list missing;
93 title1 'Diagnostic Post-Merge - Sickpay * Sickpayx';
94 title2 'Round 3 Continuation Current Main Jobs Only';
95 run;

NOTE: There were 7035 observations read from the data set WORK.J09R3F.
NOTE: The PROCEDURE FREQ printed page 4.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.04 seconds
cpu time 0.00 seconds

96
97 OPTIONS LS=132 PS=79;
98
99 /***************************************************************************/

Return to Top

Print Sample of Continuation Round 3 Records

Obs DUPERSID PANEL RN JOBSN SUBTYPE STILLAT SICKPAY
1 80005101 13 3 1 1 1 -1
2 80006101 13 3 1 1 1 -1
3 80013101 13 3 1 1 1 -1
4 80013102 13 3 1 1 1 -1
5 80017102 13 3 1 1 1 -1
6 80017201 13 3 1 1 1 -1
7 80019101 13 3 1 1 1 -1
8 80019102 13 3 1 1 1 -1
9 80019104 13 3 1 1 1 -1
10 80021102 13 3 1 1 1 -1
11 80022101 13 3 1 1 1 -1
12 80022102 13 3 1 1 1 -1
13 80032101 13 3 1 1 1 -1
14 80032102 13 3 1 1 1 -1
15 80032106 13 3 1 1 1 -1
16 80035101 13 3 2 1 1 -1
17 80036101 13 3 3 1 1 -1
18 80036102 13 3 1 1 1 -1
19 80037101 13 3 1 1 1 -1
20 80037102 13 3 1 1 1 -1

Return to Top

Print Sample of Newly Reported Round 1 and Round 2 Records

Obs DUPERSID PANEL RN JOBSN SUBTYPE STILLAT SICKPAY
1 80002102 13 1 1 1 -1 1
2 80005101 13 1 1 1 -1 2
3 80005103 13 2 1 1 -1 1
4 80006101 13 1 1 1 -1 2
5 80013101 13 1 1 1 -1 1
6 80013102 13 2 1 1 -1 2
7 80017102 13 1 1 1 -1 1
8 80017103 13 1 1 1 -1 -8
9 80017201 13 2 1 1 -1 -8
10 80019101 13 1 1 1 -1 1
11 80019102 13 1 1 1 -1 2
12 80019103 13 1 1 1 -1 1
13 80019104 13 1 1 1 -1 2
14 80020101 13 1 1 1 -1 2
15 80021102 13 1 1 1 -1 2
16 80022101 13 1 1 1 -1 1
17 80022102 13 1 1 1 -1 -1
18 80027101 13 1 1 1 -1 2
19 80032101 13 1 1 1 -1 2
20 80032102 13 1 1 1 -1 2

Return to Top

Sickpay Value of FY2008 Round 1 and Round 2 Newly Reported CMJs

DOES PERSON HAVE PAID SICK LEAVE

SICKPAY Frequency Percent Cumulative
Frequency
Cumulative
Percent
-9 28 0.28 28 0.28
-8 319 3.20 347 3.48
-7 22 0.22 369 3.71
-1 1020 10.24 1389 13.95
1 4731 47.50 6120 61.45
2 3839 38.55 9959 100.00

Return to Top

Diagnostic Post-Merge - Sickpay * Sickpayx
Round 3 Continuation Current Main Jobs Only

SICKPAY SICKPAYX Frequency Percent Cumulative
Frequency
Cumulative
Percent
-1 -9 17 0.24 17 0.24
-1 -8 196 2.79 213 3.03
-1 -7 13 0.18 226 3.21
-1 -1 814 11.57 1040 14.78
-1 1 3729 53.01 4769 67.79
-1 2 2266 32.21 7035 100.00

Return to Top

<< previous page