MEPS HC-142: Appendix 1. Sample SAS Program


1 The SAS System 16:35 Thursday, January 17, 2013
2 NOTE: Copyright (c) 2002-2008 by SAS Institute Inc., Cary, NC, USA.
3 NOTE: SAS (r) Proprietary Software 9.2 (TS2M3)
4
5 /* APP11.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 FY2010 JOBS file when */
14 /* a Round 3 current main job in the FY2011 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 jobs10 "c:\mydata\jobs10";
24 libname jobs11 "c:\mydata\jobs11";
25
26 /* Select continuing Panel 15, Round 3 Current Main JOBS */
27 /* (SUBTYPE=1, STILLAT=1) from the FY 2011 JOBS file and */
28 /* print selected variables from the first 20 observations */
29
30 data j11r3;
31 set jobs11.jobs11;
32 if panel=15
33 and rn=3
34 and subtype=1
35 and stillat=1
36 and sickpay=-1;
37 run;

NOTE: There were 56907 observations read from the data set JOBS11.JOBS11.
NOTE: The data set WORK.J11R3 has 5517 observations and 87 variables.
NOTE: DATA statement used (Total process time):
real time 2.67 seconds
cpu time 0.01 seconds

38
39 proc print data=j11r3 (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.J11R3.
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 15 Current Main JOBS records from */
46 /* the FY 2010 JOBS file and print selected variables from the */
47 /* first 20 observations. */
48
49 data j1012;
50 set jobs10.jobs10;
51 if subtype=1
52 and stillat=-1
53 and panel=15
54 and rn in (1,2);
55 run;

NOTE: There were 52159 observations read from the data set JOBS10.JOBS10.
NOTE: The data set WORK.J1012 has 7515 observations and 87 variables.
NOTE: DATA statement used (Total process time):
real time 2.62 seconds
cpu time 0.14 seconds

56
57 proc print data=j1012 (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.J1012.
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=j1012;
63 tables sickpay/list missing;
64 title 'Sickpay Value of FY2010 Round 1 and Round 2 Newly Reported CMJs';
65 run;

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

66
67
68 /* Prepare FY10 and FY11 data for merge */
69
70 proc sort data=j11r3;
71 by dupersid jobsn;
72 run;

NOTE: There were 5517 observations read from the data set WORK.J11R3.
NOTE: SAS sort was used.
NOTE: The data set WORK.J11R3 has 5517 observations and 87 variables.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds

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

NOTE: There were 7515 observations read from the data set WORK.J1012.
NOTE: SAS sort was used.
NOTE: The data set WORK.J1012 has 7515 observations and 87 variables.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds

77
78
79 /* Create a dataset (J11R3F) 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 j11r3f;
85 merge j11r3 (in=a) j1012 (in=b keep = dupersid jobsn sickpay
86 rename=(sickpay=SICKPAYX));
87 by dupersid jobsn;
88 if a and b;
89 run;

NOTE: There were 5517 observations read from the data set WORK.J11R3.
NOTE: There were 7515 observations read from the data set WORK.J1012.
NOTE: The data set WORK.J11R3F has 5515 observations and 88 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds

90
91 proc freq data=j11r3f;
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 5515 observations read from the data set WORK.J11R3F.
NOTE: The PROCEDURE FREQ printed page 4.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.00 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 10007101 15 3 1 1 1 -1
2 10008101 15 3 1 1 1 -1
3 10008102 15 3 1 1 1 -1
4 10014101 15 3 1 1 1 -1
5 10014102 15 3 1 1 1 -1
6 10016102 15 3 1 1 1 -1
7 10018101 15 3 1 1 1 -1
8 10019103 15 3 2 1 1 -1
9 10021102 15 3 1 1 1 -1
10 10022101 15 3 1 1 1 -1
11 10024101 15 3 1 1 1 -1
12 10024102 15 3 1 1 1 -1
13 10024103 15 3 2 1 1 -1
14 10026101 15 3 1 1 1 -1
15 10030101 15 3 1 1 1 -1
16 10034101 15 3 1 1 1 -1
17 10034102 15 3 3 1 1 -1
18 10035101 15 3 1 1 1 -1
19 10035102 15 3 1 1 1 -1
20 10036101 15 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 10007101 15 1 1 1 -1 1
2 10008101 15 1 1 1 -1 1
3 10008102 15 1 1 1 -1 1
4 10014101 15 1 1 1 -1 2
5 10014102 15 1 1 1 -1 2
6 10016102 15 1 1 1 -1 -1
7 10018101 15 1 1 1 -1 1
8 10019103 15 1 1 1 -1 1
9 10019103 15 2 2 1 -1 2
10 10021102 15 1 1 1 -1 1
11 10022101 15 2 1 1 -1 2
12 10024101 15 1 1 1 -1 1
13 10024102 15 1 1 1 -1 1
14 10024103 15 1 1 1 -1 2
15 10024103 15 2 2 1 -1 -1
16 10025101 15 1 1 1 -1 2
17 10025101 15 2 2 1 -1 2
18 10026101 15 1 1 1 -1 1
19 10030101 15 1 1 1 -1 2
20 10034101 15 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 15 0.20 15 0.20
-8 220 2.93 235 3.13
-7 20 0.27 255 3.39
-1 884 11.76 1139 15.16
1 3516 46.79 4655 61.94
2 2860 38.06 7515 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 4 0.07 4 0.07
-1 -8 136 2.47 140 2.54
-1 -7 15 0.27 155 2.81
-1 -1 721 13.07 876 15.88
-1 1 2859 51.84 3735 67.72
-1 2 1780 32.28 5515 100.00

Return to Top