MEPS HC-150: Appendix 1. Sample SAS Program
1 The SAS System 12:47 Monday, January 20, 2014
2 NOTE: Copyright (c) 2002-2010 by SAS Institute Inc., Cary, NC, USA.
3 NOTE: SAS (r) Proprietary Software 9.3 (TS1M2)
4
5 /* APP12.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 FY2011 JOBS file when */
14 /* a Round 3 current main job in the FY2012 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 jobs11 "c:\mydata\jobs11";
24 libname jobs12 "c:\mydata\jobs12";
25
26 /* Select continuing Panel 16, Round 3 Current Main JOBS */
27 /* (SUBTYPE=1, STILLAT=1) from the FY 2012 JOBS file and */
28 /* print selected variables from the first 20 observations */
29
30 data j12r3;
31 set jobs12.jobs12;
32 if panel=16
33 and rn=3
34 and subtype=1
35 and stillat=1
36 and sickpay=-1;
37 run;
NOTE: There were 61969 observations read from the data set JOBS12.JOBS12.
NOTE: The data set WORK.J12R3 has 6916 observations and 87 variables.
NOTE: Compressing data set WORK.J12R3 decreased size by 10.34 percent.
Compressed is 130 pages; un-compressed would require 145 pages.
NOTE: DATA statement used (Total process time):
real time 2.91 seconds
cpu time 0.14 seconds
38
39 proc print data=j12r3 (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.J12R3.
NOTE: The PROCEDURE PRINT printed page 1.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.07 seconds
cpu time 0.06 seconds
43
44
45 /* Select newly reported Panel 16 Current Main JOBS records from */
46 /* the FY 2011 JOBS file and print selected variables from the */
47 /* first 20 observations. */
48
49 data j1012;
50 set jobs11.jobs11;
51 if subtype=1
52 and stillat=-1
53 and panel=16
54 and rn in (1,2);
55 run;
NOTE: There were 56907 observations read from the
data set JOBS11.JOBS11.
NOTE: The data set WORK.J1112 has 9509 observations and 87 variables.
NOTE: Compressing data set WORK.J1112 decreased size by 10.55 percent.
Compressed is 178 pages; un-compressed would require 199 pages.
NOTE: DATA statement used (Total process time):
real time 4.16 seconds
cpu time 0.06 seconds
56
57 proc print data=j1112 (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.J1112.
NOTE: The PROCEDURE PRINT printed page 2.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.00 seconds
cpu time 0.01 seconds
61
62 proc freq data=j1112;
63 tables sickpay/list missing;
64 title 'Sickpay Value of FY2011 Round 1 and Round 2
Newly Reported CMJs';
65 run;
NOTE: There were 9509 observations read from the data
set WORK.J1112.
NOTE: The PROCEDURE FREQ printed page 3.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.09 seconds
cpu time 0.03 seconds
66
67
68 /* Prepare FY11 and FY12 data for merge */
69
70 proc sort data=j12r3;
71 by dupersid jobsn;
72 run;
NOTE: There were 6916 observations read from the
data set WORK.J12R3.
NOTE: SAS sort was used.
NOTE: The data set WORK.J12R3 has 6916 observations
and 87 variables.
NOTE: Compressing data set WORK.J12R3 decreased size
by 10.34 percent.
Compressed is
130 pages; un-compressed would require 145 pages.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.10 seconds
cpu time 0.01 seconds
73
74 proc sort data=j1012;
75 by dupersid jobsn;
76 run;
NOTE: There were 9509 observations read from the
data set WORK.J1112.
NOTE: SAS sort was used.
NOTE: The data set WORK.J1112 has 9509 observations
and 87 variables.
NOTE: Compressing data set WORK.J1112 decreased size
by 10.55 percent.
Compressed is
178 pages; un-compressed would require 199 pages.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.03 seconds
cpu time 0.03 seconds
77
78
79 /* Create a dataset (J12R3F) 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 j12r3f;
85 merge j12r3 (in=a) j1112 (in=b keep = dupersid
jobsn sickpay
86 rename=(sickpay=SICKPAYX));
87 by dupersid jobsn;
88 if a and b;
89 run;
NOTE: There were 6916 observations read from the data
set WORK.J12R3.
NOTE: There were 9509 observations read from the
data set WORK.J1112.
NOTE: The data set WORK.J12R3F has 6914 observations
and 88 variables.
NOTE: Compressing data set WORK.J12R3F decreased
size by 8.28 percent.
Compressed is
133 pages; un-compressed would require 145 pages.
NOTE: DATA statement used (Total process time):
real time 0.03 seconds
cpu time 0.03 seconds
90
91 proc freq data=j12r3f;
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 6914 observations read from the
data set WORK.J12R3F.
NOTE: The PROCEDURE FREQ printed page 4.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.04 seconds
cpu time 0.03 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 |
30002101 |
16 |
3 |
1 |
1 |
1 |
-1 |
2 |
30002102 |
16 |
3 |
1 |
1 |
1 |
-1 |
3 |
30003103 |
16 |
3 |
1 |
1 |
1 |
-1 |
4 |
30007101 |
16 |
3 |
1 |
1 |
1 |
-1 |
5 |
30007102 |
16 |
3 |
1 |
1 |
1 |
-1 |
6 |
30008101 |
16 |
3 |
3 |
1 |
1 |
-1 |
7 |
30008102 |
16 |
3 |
3 |
1 |
1 |
-1 |
8 |
30008103 |
16 |
3 |
1 |
1 |
1 |
-1 |
9 |
30008201 |
16 |
3 |
1 |
1 |
1 |
-1 |
10 |
30010102 |
16 |
3 |
1 |
1 |
1 |
-1 |
11 |
30011102 |
16 |
3 |
1 |
1 |
1 |
-1 |
12 |
30013101 |
16 |
3 |
1 |
1 |
1 |
-1 |
13 |
30013102 |
16 |
3 |
1 |
1 |
1 |
-1 |
14 |
30015101 |
16 |
3 |
1 |
1 |
1 |
-1 |
15 |
30015102 |
16 |
3 |
1 |
1 |
1 |
-1 |
16 |
30016102 |
16 |
3 |
2 |
1 |
1 |
-1 |
17 |
30017101 |
16 |
3 |
1 |
1 |
1 |
-1 |
18 |
30020101 |
16 |
3 |
1 |
1 |
1 |
-1 |
19 |
30022101 |
16 |
3 |
1 |
1 |
1 |
-1 |
20 |
30024101 |
16 |
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 |
30002101 |
16 |
1 |
1 |
1 |
-1 |
2 |
2 |
30002102 |
16 |
1 |
1 |
1 |
-1 |
1 |
3 |
30003103 |
16 |
2 |
1 |
1 |
-1 |
2 |
4 |
30004104 |
16 |
2 |
1 |
1 |
-1 |
2 |
5 |
30007101 |
16 |
1 |
1 |
1 |
-1 |
-1 |
6 |
30007102 |
16 |
1 |
1 |
1 |
-1 |
1 |
7 |
30008101 |
16 |
1 |
3 |
1 |
-1 |
2 |
8 |
30008102 |
16 |
1 |
3 |
1 |
-1 |
1 |
9 |
30008103 |
16 |
1 |
1 |
1 |
-1 |
2 |
10 |
30008201 |
16 |
1 |
1 |
1 |
-1 |
1 |
11 |
30009103 |
16 |
1 |
1 |
1 |
-1 |
2 |
12 |
30009103 |
16 |
2 |
2 |
1 |
-1 |
1 |
13 |
30010101 |
16 |
1 |
1 |
1 |
-1 |
1 |
14 |
30010102 |
16 |
1 |
1 |
1 |
-1 |
1 |
15 |
30011102 |
16 |
1 |
1 |
1 |
-1 |
1 |
16 |
30011103 |
16 |
1 |
1 |
1 |
-1 |
1 |
17 |
30013101 |
16 |
1 |
1 |
1 |
-1 |
1 |
18 |
30013102 |
16 |
1 |
1 |
1 |
-1 |
1 |
19 |
30014103 |
16 |
1 |
1 |
1 |
-1 |
2 |
20 |
30015101 |
16 |
1 |
1 |
1 |
-1 |
-1 |
Return to Top
Sickpay Value of FY2010 Round 1 and Round 2 Newly
Reported CMJs
DOES PERSON HAVE PAID SICK LEAVE
SICKPAY |
Frequency |
Percent |
Cumulative Frequency |
Cumulative Percent |
-9 |
25 |
0.26 |
25 |
0.26 |
-8 |
281 |
2.96 |
306 |
3.22 |
-7 |
30 |
0.32 |
336 |
3.53 |
-1 |
1041 |
10.95 |
1377 |
14.48 |
1 |
4335 |
45.59 |
5712 |
60.07 |
2 |
3797 |
39.93 |
9509 |
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 |
15 |
0.22 |
15 |
0.22 |
-1 |
-8 |
185 |
2.68 |
200 |
2.89 |
-1 |
-7 |
16 |
0.23 |
216 |
3.12 |
-1 |
-1 |
812 |
11.74 |
1028 |
14.87 |
-1 |
1 |
3503 |
50.67 |
4531 |
65.53 |
-1 |
2 |
2383 |
34.47 |
6914 |
100.00 |
Return to Top
|