Appendix 1: Sample SAS Program
1 The SAS System 17:23 Wednesday, March 13, 2002
NOTE: Copyright (c) 1989-1996 by SAS Institute Inc., Cary, NC, USA.
NOTE: SAS (r) Proprietary Software Release 6.12 TS060
1 *------------------------------------------------------------------------
2 *
3 * Program Name: SAMPLE.SAS
4 *
5 * Description: This job provides an example of how to get job info
6 * from Round 1 in the FY 1998 JOBS file when a Round 2
7 * current main job in the FY 1999 JOBS file is a
8 * continuation job.
9 *
10 * This example creates a data set of Round 2 continuation
11 * JOB records with a SICKPAYX variable copied from the
12 * Round 1 newly reported job.
13 *
14 *-----------------------------------------------------------------------;
15
16
17 libname jobs99 'c:\mydata\jobs99';
NOTE: Libref JOBS99 was successfully assigned as follows:
Engine: V612 Physical Name: c:\mydata\jobs99
18 libname jobs98 'c:\mydata\jobs98';
NOTE: Libref JOBS98 was successfully assigned as follows:
Engine: V612 Physical Name: c:\mydata\jobs98
19
20 /*Select continuing Panel 3 Round 2 current main jobs */
21 /*from the FY 1999 JOBS file and print selected variables*/
22 /*from the first 20 observations. */
23
24 data j99r2;
25 set jobs99.h32;
26 if panel=3 and
27 rn=2 and
28 subtype=1 and
29 stillat=1 and
30 sickpay=-1;
31 run;
NOTE: The data set WORK.J99R2 has 3936 observations and 88 variables.
NOTE: The DATA statement used 0.98 seconds.
2 The SAS System 17:23 Wednesday, March 13, 2002
32
33 proc print data=j99r2(obs=20);
34 title 'Print Sample of Continuation Round 2 Records';
35 var dupersid rn jobsn subtype stillat sickpay;
36 run;
NOTE: The PROCEDURE PRINT printed page 1.
NOTE: The PROCEDURE PRINT used 0.22 seconds.
37
38 /*Select newly reported Panel 3 Round 1 current main jobs*/
39 /*from the FY 1998 JOBS file and print selected variables*/
40 /*from the first 20 observations. */
41
42 data j98r1;
43 set jobs98.h25;
44 if panel=3 and
45 rn=1 and
46 subtype=1 and
47 stillat=-1;
48 run;
NOTE: The data set WORK.J98R1 has 5103 observations and 88 variables.
NOTE: The DATA statement used 1.48 seconds.
49
50 proc print data=j98r1(obs=20);
51 title 'Print Sample of Newly Reported Round 1 Records';
52 var dupersid rn jobsn subtype stillat sickpay;
53 run;
NOTE: The PROCEDURE PRINT printed page 2.
NOTE: The PROCEDURE PRINT used 0.0 seconds.
54
55 proc sort data=j99r2;
56 by dupersid jobsn;
57 run;
NOTE: The data set WORK.J99R2 has 3936 observations and 88 variables.
NOTE: The PROCEDURE SORT used 0.27 seconds.
3 The SAS System 17:23 Wednesday, March 13, 2002
58
59 proc sort data=j98r1;
60 by dupersid jobsn;
61 run;
NOTE: The data set WORK.J98R1 has 5103 observations and 88 variables.
NOTE: The PROCEDURE SORT used 0.55 seconds.
62
63 /*Create a dataset (J99R2F) that includes all variables */
64 /*for the continuation Round 2 JOBS and create the new */
65 /*variable SICKPAYX by copying SICKPAY from the */
66 /*corresponding Round 1 newly reported record. */
67
68 data j99r2f;
69 merge j99r2(in=a) j98r1(in=b keep=dupersid jobsn sickpay
70 rename=(sickpay=sickpayx));
71 by dupersid jobsn;
72 if a and b;
73 run;
NOTE: The data set WORK.J99R2F has 3936 observations and 89 variables.
NOTE: The DATA statement used 0.33 seconds.
74
75 proc freq data=j99r2f;
76 tables sickpay*sickpayx/list missing;
77 title1 'Diagnostic Post-Merge - SICKPAY*SICKPAYX';
78 title2 'Round 2 continuation current main jobs only';
79 run;
NOTE: The PROCEDURE FREQ printed page 3.
NOTE: The PROCEDURE FREQ used 0.16 seconds.
NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414
Print Sample of Continuation Round 2 Records 1 17:23 Wednesday, March 13, 2002
OBS DUPERSID RN JOBSN SUBTYPE STILLAT SICKPAY
1 65158013 2 1 1 1 -1
2 61032010 2 1 1 1 -1
3 62169017 2 1 1 1 -1
4 62169031 2 1 1 1 -1
5 62169048 2 1 1 1 -1
6 62169052 2 1 1 1 -1
7 60042014 2 1 1 1 -1
8 63662010 2 1 1 1 -1
9 61864017 2 1 1 1 -1
10 61864024 2 1 1 1 -1
11 64166011 2 1 1 1 -1
12 60354013 2 1 1 1 -1
13 60398010 2 1 1 1 -1
14 60398027 2 1 1 1 -1
15 65113011 2 1 1 1 -1
16 65113028 2 1 1 1 -1
17 60944021 2 1 1 1 -1
18 62882011 2 1 1 1 -1
19 62882028 2 1 1 1 -1
20 63810017 2 1 1 1 -1
Print Sample of Newly Reported Round 1 Records 2 17:23 Wednesday, March 13, 2002
OBS DUPERSID RN JOBSN SUBTYPE STILLAT SICKPAY
1 60001027 1 1 1 -1 -1
2 60001034 1 1 1 -1 2
3 60001041 1 1 1 -1 2
4 60002015 1 1 1 -1 -1
5 60003013 1 1 1 -1 2
6 60005017 1 1 1 -1 -1
7 60005024 1 1 1 -1 -1
8 60007013 1 1 1 -1 2
9 60007020 1 1 1 -1 2
10 60008024 1 1 1 -1 2
11 60010016 1 1 1 -1 1
12 60010023 1 1 1 -1 2
13 60014018 1 1 1 -1 2
14 60015015 1 1 1 -1 1
15 60018020 1 1 1 -1 1
16 60019010 1 1 1 -1 2
17 60019027 1 1 1 -1 -1
18 60020013 1 1 1 -1 2
19 60020020 1 1 1 -1 -1
20 60022014 1 1 1 -1 1
Diagnostic Post-Merge - SICKPAY*SICKPAYX 3
Round 2 continuation current main jobs only 17:23 Wednesday, March 13, 2002
Cumulative Cumulative
SICKPAY SICKPAYX Frequency Percent Frequency Percent
--------------------------------------------------------------
-1 -9 2 0.1 2 0.1
-1 -8 94 2.4 96 2.4
-1 -7 2 0.1 98 2.5
-1 -1 488 12.4 586 14.9
-1 1 2172 55.2 2758 70.1
-1 2 1178 29.9 3936 100.0
<< previous page
|