MEPS HC-116: Appendix 1. Sample SAS Program


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 /* APP08.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 FY2007 JOBS file when */
14 /* a Round 3 current main job in the FY2008 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 jobs07 "c:\mydata\jobs07";
24 libname jobs08 "c:\mydata\jobs08";
25
26 /* Select continuing Panel 12, Round 3 Current Main JOBS */
27 /* (SUBTYPE=1, STILLAT=1) from the FY 2008 JOBS file and */
28 /* print selected variables from the first 20 observations */
29
30 data j08r3;
31 set jobs08.jobs08;
32 if panel=12
33 and rn=3
34 and subtype=1
35 and stillat=1
36 and sickpay=-1;
37 run;

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

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

NOTE: There were 52306 observations read from the data set JOBS07.JOBS07.
NOTE: The data set WORK.J0712 has 6975 observations and 87 variables.
NOTE: DATA statement used (Total process time):
real time 3.13 seconds
cpu time 0.26 seconds

56
57 proc print data=j0712 (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.J0712.
NOTE: The PROCEDURE PRINT printed page 2.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds

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

NOTE: There were 6975 observations read from the data set WORK.J0712.
NOTE: The PROCEDURE FREQ printed page 3.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.06 seconds
cpu time 0.03 seconds

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

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

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

NOTE: There were 6975 observations read from the data set WORK.J0712.
NOTE: The data set WORK.J0712 has 6975 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 (J08R3F) 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 j08r3f;
85 merge j08r3 (in=a) j0712 (in=b keep = dupersid jobsn sickpay
86 rename=(sickpay=SICKPAYX));
87 by dupersid jobsn;
88 if a and b;
89 run;

NOTE: There were 4927 observations read from the data set WORK.J08R3.
NOTE: There were 6975 observations read from the data set WORK.J0712.
NOTE: The data set WORK.J08R3F has 4924 observations and 88 variables.
NOTE: DATA statement used (Total process time):
real time 0.03 seconds
cpu time 0.03 seconds

90
91 proc freq data=j08r3f;
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 4924 observations read from the data set WORK.J08R3F.
NOTE: The PROCEDURE FREQ printed page 4.
NOTE: PROCEDURE FREQ used (Total process time):
real time 0.06 seconds
cpu time 0.01 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 70001101 12 3 1 1 1 -1
2 70003101 12 3 1 1 1 -1
3 70004101 12 3 1 1 1 -1
4 70004102 12 3 1 1 1 -1
5 70008101 12 3 2 1 1 -1
6 70008102 12 3 1 1 1 -1
7 70010101 12 3 1 1 1 -1
8 70013101 12 3 3 1 1 -1
9 70013102 12 3 1 1 1 -1
10 70014102 12 3 1 1 1 -1
11 70015101 12 3 1 1 1 -1
12 70015201 12 3 1 1 1 -1
13 70016101 12 3 1 1 1 -1
14 70021101 12 3 1 1 1 -1
15 70022101 12 3 1 1 1 -1
16 70025101 12 3 2 1 1 -1
17 70027102 12 3 1 1 1 -1
18 70028101 12 3 1 1 1 -1
19 70029101 12 3 2 1 1 -1
20 70032101 12 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 70001101 12 1 1 1 -1 1
2 70003101 12 2 1 1 -1 2
3 70004101 12 1 1 1 -1 1
4 70004102 12 1 1 1 -1 1
5 70006101 12 1 1 1 -1 1
6 70006102 12 1 1 1 -1 1
7 70008101 12 1 1 1 -1 2
8 70008101 12 2 2 1 -1 2
9 70008102 12 1 1 1 -1 2
10 70010101 12 1 1 1 -1 -1
11 70010102 12 1 1 1 -1 2
12 70013101 12 1 2 1 -1 1
13 70013101 12 2 3 1 -1 1
14 70013102 12 1 1 1 -1 2
15 70013103 12 1 1 1 -1 2
16 70014102 12 1 1 1 -1 1
17 70015101 12 1 1 1 -1 1
18 70015201 12 1 1 1 -1 1
19 70016101 12 1 1 1 -1 1
20 70018102 12 1 1 1 -1 2

Return to Top

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

DOES PERSON HAVE PAID SICK LEAVE

SICKPAY Frequency Percent Cumulative
Frequency
Cumulative
Percent
-9 22 0.32 22 0.32
-8 192 2.75 214 3.07
-7 13 0.19 227 3.25
-1 835 11.97 1062 15.23
1 3284 47.08 4346 62.31
2 2629 37.69 6975 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 10 0.20 10 0.20
-1 -8 118 2.40 128 2.60
-1 -7 10 0.20 138 2.80
-1 -1 656 13.32 794 16.13
-1 1 2561 52.01 3355 68.14
-1 2 1569 31.86 4924 100.00

Return to Top