1065
for EmpID.
The values of JobCode and Salary are different in these observations.
DateOfBirth
|
DateOfHire
|
EmpID
|
Gender
|
JobCode
|
Salary
|
---|---|---|---|---|---|
05MAR1957
|
30MAR1990
|
1009
|
M
|
TA1
|
$40,432
|
01JAN1956
|
20OCT1979
|
1017
|
M
|
TA3
|
$57,201
|
23MAY1963
|
27OCT1982
|
1036
|
F
|
TA3
|
$55,149
|
14APR1962
|
17SEP1990
|
1037
|
F
|
TA1
|
$39,98
|
13NOV1967
|
26NOV1989
|
1038
|
F
|
TA1
|
$37,146
|
17JUL1961
|
27AUG1984
|
1050
|
M
|
ME2
|
$49,234
|
29JAN1942
|
10JAN1985
|
1065
|
M
|
ME2
|
$49,126
|
18OCT1970
|
06OCT1989
|
1076
|
M
|
PT1
|
$93,181
|
DateOfBirth
|
DateOfHire
|
EmpID
|
Gender
|
JobCode
|
Salary
|
---|---|---|---|---|---|
30JUN1955
|
31JAN1982
|
1639
|
F
|
TA3
|
$59,164
|
29JAN1942
|
10JAN1985
|
1065
|
M
|
ME3
|
$53,326
|
03DEC1961
|
10Oct1985
|
1561
|
M
|
TA3
|
$51,120
|
25SEP1965
|
07OCT1989
|
1221
|
F
|
FA3
|
$41,854
|
11AUG1970
|
01NOV2000
|
1447
|
F
|
FA1
|
$30,340
|
13SEP1968
|
05NOV2000
|
1998
|
M
|
SCP
|
$32,240
|
General form, UPDATE
statement:
DATA master-data-set;
UPDATE master-data-set
transaction-data-set;
BY by-variable(s);
RUN;
master-data-set
names the SAS data
set used as the master file.
transaction-data-set
names the SAS data
set that contains the changes to be applied to the master data set.
by-variable(s)
names a variable that
appears in both master-data-set and
in transaction-data-set. Each
observation in master-data-set must
have a unique value for by-variable,
but transaction-data-set can
contain more than one observation with the same by-variable value.
|
proc sort data=mylib.empmaster; by empid; run; proc sort data=mylib.empchanges; by empid; run; data mylib.empmaster; update mylib.empmaster mylib.empchanges; by empid; run;
1065
for
EmpID now contains the updated values for JobCode and Salary.proc print data=mylib.empmaster (obs=8) noobs; run;