MEPS HC-133: Appendix 1. Sample SAS Program


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

NOTE: There were 52159 observations read from the data set JOBS10.JOBS10.
NOTE: The data set WORK.J10R3 has 6188 observations and 87 variables.
NOTE: DATA statement used (Total process time):
real time 3.06 seconds
cpu time 0.21 seconds

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

NOTE: There were 59454 observations read from the data set JOBS09.JOBS09.
NOTE: The data set WORK.J0912 has 8367 observations and 87 variables.
NOTE: DATA statement used (Total process time):
real time 3.60 seconds
cpu time 0.25 seconds

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

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

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

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

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

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

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

NOTE: There were 6188 observations read from the data set WORK.J10R3.
NOTE: There were 8367 observations read from the data set WORK.J0912.
NOTE: The data set WORK.J10R3F has 6185 observations and 88 variables.
NOTE: DATA statement used (Total process time):
real time 0.06 seconds
cpu time 0.04 seconds

90
91 proc freq data=j10r3f;
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 6185 observations read from the data set WORK.J10R3F.
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 40001101 14 3 1 1 1 -1
2 40001102 14 3 1 1 1 -1
3 40002101 14 3 1 1 1 -1
4 40003101 14 3 1 1 1 -1
5 40005101 14 3 1 1 1 -1
6 40005102 14 3 1 1 1 -1
7 40005103 14 3 1 1 1 -1
8 40006101 14 3 1 1 1 -1
9 40006102 14 3 1 1 1 -1
10 40006103 14 3 1 1 1 -1
11 40009102 14 3 1 1 1 -1
12 40012101 14 3 1 1 1 -1
13 40014101 14 3 1 1 1 -1
14 40017103 14 3 1 1 1 -1
15 40019101 14 3 2 1 1 -1
16 40019102 14 3 1 1 1 -1
17 40020101 14 3 1 1 1 -1
18 40021102 14 3 1 1 1 -1
19 40022101 14 3 1 1 1 -1
20 40024101 14 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 40001101 14 1 1 1 -1 1
2 40001102 14 1 1 1 -1 1
3 40002101 14 1 1 1 -1 1
4 40003101 14 1 1 1 -1 1
5 40003103 14 1 1 1 -1 2
6 40004101 14 1 1 1 -1 2
7 40005101 14 1 1 1 -1 1
8 40005102 14 1 1 1 -1 1
9 40005103 14 1 1 1 -1 1
10 40006101 14 1 1 1 -1 1
11 40006102 14 1 1 1 -1 1
12 40006103 14 1 1 1 -1 2
13 40009102 14 1 1 1 -1 1
14 40012101 14 2 1 1 -1 2
15 40014101 14 1 1 1 -1 2
16 40017102 14 1 1 1 -1 1
17 40017103 14 1 1 1 -1 1
18 40019101 14 1 1 1 -1 2
19 40019101 14 2 2 1 -1 2
20 40019102 14 1 1 1 -1 2

Return to Top

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

DOES PERSON HAVE PAID SICK LEAVE

SICKPAY Frequency Percent Cumulative
Frequency
Cumulative
Percent
-9 12 0.14 12 0.14
-8 240 2.87 252 3.01
-7 18 0.22 270 3.23
-1 932 11.14 1202 14.37
1 3981 47.58 5183 61.95
2 3184 38.05 8367 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 11 0.18 11 0.18
-1 -8 153 2.47 164 2.65
-1 -7 13 0.21 177 2.86
-1 -1 722 11.67 899 14.54
-1 1 3248 52.51 4147 67.05
-1 2 2038 32.95 6185 100.00

Return to Top