MEPS HC-203: 2018 Jobs File
Appendix 2: Sample Stata Program
5 *** APP18.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 FY2017 JOBS file
when ***
14 *** a Round 3 current main job in the FY2018 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 jobs17 “c:\mydata\jobs17";
24 libname jobs18 “c:\mydata\jobs18";
25
26 *** Select continuing Panel 22, Round 3 Current
Main JOBS ***
27 *** (SUBTYPE=1, STILLAT=1) from the FY 2018 JOBS
file and ***
28 *** print selected variables from the first 20
observations ***;
29
30 data j18r3;
31 set jobs18.jobs18;
32 if panel=22
33 and rn=3
34 and subtype=1
35 and stillat=1
36 and sickpay=-1;
37 length jobsn 3;
38 jobsn = input(substr(jobsidx_17, 11, 1),3.);
39 dupid17 = substr(dupersid, 3, 8);
40 run;
NOTE: There were 53323 observations read from the data set JOBS18.JOBS18.
NOTE: The data set WORK.J18R3 has 5590 observations and 86 variables.
NOTE: Compressing data set WORK.J18R3 decreased size by 6.45 percent.
Compressed is 29 pages; un-compressed would require 31 pages.
41
42 proc print data=j18r3 (obs=20);
43 title 'Print Sample of Continuation Round 3 Records';
44 var dupid17 panel rn jobsn subtype stillat sickpay;
45 run;
NOTE: There were 20 observations read from the data set WORK.J18R3.
NOTE: The PROCEDURE PRINT printed page 1.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.03 seconds
cpu time 0.03 seconds
46
47
48 *** Select newly reported Panel 22 Current Main JOBS records from ***
49 *** the FY 2017 JOBS file and print selected variables from the ***
50 *** first 20 observations. ***;
51
52 data j1712;
53 set jobs17.jobs17 (rename=(dupersid=dupid17);
54 if subtype=1
55 and stillat=-1
56 and panel=22
57 and rn in (1,2);
58 run;
NOTE: There were 55035 observations read from the data set JOBS17.JOBS17.
NOTE: The data set WORK.J1712 has 7776 observations and 79 variables.
NOTE: Compressing data set WORK.J1712 decreased size by 5.41 percent.
Compressed is 35 pages; un-compressed would require 37 pages.
NOTE: DATA statement used (Total process time):
real time 0.45 seconds
cpu time 0.06 seconds
59
60 proc print data=j1712 (obs=20);
61 title 'Print Sample of Newly Reported Round 1 and Round 2 Records';
62 var dupid17 panel rn jobsn subtype stillat sickpay;
63 run;
NOTE: There were 20 observations read from the data set WORK.J1712.
NOTE: The PROCEDURE PRINT printed page 2.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
64
65 proc freq data=j1712;
66 tables sickpay/list missing;
67 title 'Sickpay Value of FY2017 Round 1 and Round 2 Newly Reported CMJs';
68 run;
NOTE: There were 7776 observations read from the data set WORK.J1712.
NOTE: The PROCEDURE FREQ printed page 3.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
69
70
71 *** Prepare FY17 and FY18 data for merge ***;
72
73 proc sort data=j18r3;
74 by dupid17 jobsn;
75 run;
NOTE: There were 5590 observations read from the data set WORK.J18R3.
NOTE: SAS sort was used.
NOTE: The data set WORK.J18R3 has 5590 observations and 86 variables.
NOTE: Compressing data set WORK.J18R3 decreased size by 6.45 percent.
Compressed is 29 pages; un-compressed would require 31 pages.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
76
77 proc sort data=j1712;
78 by dupid17 jobsn;
79 run;
NOTE: There were 7776 observations read from the data set WORK.J1712.
NOTE: SAS sort was used.
NOTE: The data set WORK.J1712 has 7776 observations and 79 variables.
NOTE: Compressing data set WORK.J1712 decreased size by 5.41 percent.
Compressed is 35 pages; un-compressed would require 37 pages.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
80
81
82 *** Create a dataset (J18R3F) that includes all variables ***
83 *** for the continuation Round 3 Current Main JOBS and create ***
84 *** the new variable SICKPAYX by copying SICKPAY from the ***
85 *** corresponding Round 1 or Round 2 newly reported job record. ***;
86
87 data j18r3f;
88 merge j18r3 (in=a) j1712 (in=b keep = dupid17 jobsn sickpay
89 rename=(sickpay=SICKPAYX));
90 by dupid17 jobsn;
91 if a and b;
92 run;
NOTE: There were 5590 observations read from the data set WORK.J18R3.
NOTE: There were 7776 observations read from the data set WORK.J1712.
NOTE: The data set WORK.J18R3F has 5590 observations and 87 variables.
NOTE: Compressing data set WORK.J18R3F decreased size by 3.23 percent.
Compressed is 30 pages; un-compressed would require 31 pages.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
93
94 proc freq data=j18r3f;
95 tables sickpay*sickpayx/list missing;
96 title1 'Diagnostic Post-Merge - Sickpay * Sickpayx';
97 title2 'Round 3 Continuation Current Main Jobs Only';
98 run;
NOTE: There were 5590 observations read from the data set WORK.J18R3F.
NOTE: The PROCEDURE FREQ printed page 4.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
Return to Top
Print Sample of Continuation Round 3 Records
Obs |
DUPID17 |
PANEL |
RN |
JOBSN |
SUBTYPE |
STILLAT |
SICKPAY |
1 |
90002101 |
22 |
3 |
1 |
1 |
1 |
-1 |
2 |
90002102 |
22 |
3 |
2 |
1 |
1 |
-1 |
3 |
90003101 |
22 |
3 |
1 |
1 |
1 |
-1 |
4 |
90005101 |
22 |
3 |
1 |
1 |
1 |
-1 |
5 |
90005102 |
22 |
3 |
1 |
1 |
1 |
-1 |
6 |
90007102 |
22 |
3 |
1 |
1 |
1 |
-1 |
7 |
90008101 |
22 |
3 |
1 |
1 |
1 |
-1 |
8 |
90008102 |
22 |
3 |
1 |
1 |
1 |
-1 |
9 |
90009102 |
22 |
3 |
1 |
1 |
1 |
-1 |
10 |
90010101 |
22 |
3 |
1 |
1 |
1 |
-1 |
11 |
90010102 |
22 |
3 |
1 |
1 |
1 |
-1 |
12 |
90016101 |
22 |
3 |
1 |
1 |
1 |
-1 |
13 |
90016102 |
22 |
3 |
1 |
1 |
1 |
-1 |
14 |
90019102 |
22 |
3 |
1 |
1 |
1 |
-1 |
15 |
90019103 |
22 |
3 |
3 |
1 |
1 |
-1 |
16 |
90019104 |
22 |
3 |
1 |
1 |
1 |
-1 |
17 |
90020101 |
22 |
3 |
1 |
1 |
1 |
-1 |
18 |
90025101 |
22 |
3 |
1 |
1 |
1 |
-1 |
19 |
90027101 |
22 |
3 |
1 |
1 |
1 |
-1 |
20 |
90030101 |
22 |
3 |
1 |
1 |
1 |
-1 |
Return to Top
Print Sample of Newly Reported Round 1 and Round 2 Records
Obs |
DUPID17 |
PANEL |
RN |
JOBSN |
SUBTYPE |
STILLAT |
SICKPAY |
1 |
90001101 |
22 |
1 |
1 |
1 |
-1 |
1 |
2 |
90001102 |
22 |
1 |
1 |
1 |
-1 |
2 |
3 |
90001102 |
22 |
2 |
2 |
1 |
-1 |
2 |
4 |
90002101 |
22 |
2 |
1 |
1 |
-1 |
2 |
5 |
90002102 |
22 |
1 |
1 |
1 |
-1 |
2 |
6 |
90002102 |
22 |
2 |
2 |
1 |
-1 |
2 |
7 |
90003101 |
22 |
2 |
1 |
1 |
-1 |
2 |
8 |
90003102 |
22 |
1 |
1 |
1 |
-1 |
2 |
9 |
90005101 |
22 |
2 |
1 |
1 |
-1 |
1 |
10 |
90005102 |
22 |
1 |
1 |
1 |
-1 |
1 |
11 |
90006101 |
22 |
1 |
1 |
1 |
-1 |
1 |
12 |
90006102 |
22 |
2 |
1 |
1 |
-1 |
2 |
13 |
90006103 |
22 |
2 |
1 |
1 |
-1 |
2 |
14 |
90007102 |
22 |
1 |
1 |
1 |
-1 |
1 |
15 |
90008101 |
22 |
1 |
1 |
1 |
-1 |
1 |
16 |
90008102 |
22 |
1 |
1 |
1 |
-1 |
1 |
17 |
90009102 |
22 |
1 |
1 |
1 |
-1 |
2 |
18 |
90010101 |
22 |
1 |
1 |
1 |
-1 |
2 |
19 |
90010102 |
22 |
1 |
1 |
1 |
-1 |
1 |
20 |
90012101 |
22 |
1 |
1 |
1 |
-1 |
-1 |
Return to Top
Sickpay Value of FY2017 Round 1 and Round 2 Newly Reported CMJs
DOES PERSON HAVE PAID SICK LEAVE
SICKPAY |
Frequency |
Percent |
Cumulative Frequency |
Cumulative Percent |
-9* |
16 |
0.21 |
16 |
0.21 |
-8 |
267 |
3.43 |
283 |
3.64 |
-7 |
12 |
0.15 |
295 |
3.79 |
-1 |
878 |
11.29 |
1173 |
15.08 |
1 |
4001 |
51.45 |
5174 |
66.54 |
2 |
2602 |
33.46 |
7776 |
100.00 |
*NOTE: -9 NOT ASCERTAINED is a valid value in the 2017
Jobs File but not in the 2018 Jobs File.
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* |
10 |
0.18 |
10 |
0.18 |
-1 |
-8 |
161 |
2.88 |
171 |
3.06 |
-1 |
-7 |
9 |
0.16 |
180 |
3.22 |
-1 |
-1 |
705 |
12.61 |
885 |
15.83 |
-1 |
1 |
3125 |
55.90 |
4010 |
71.74 |
-1 |
2 |
1580 |
28.26 |
5590 |
100.00 |
*NOTE: -9 NOT ASCERTAINED is a valid value in the 2017
Jobs File but not in the 2018 Jobs File.
Return to Top
|