You are on page 1of 6

/*Updating replaces the values of variables in one data set with

nonmissing values
from another data set.*/

data mail_list;
input SubscriberId 1-8 Name $ 9-27 StreetAddress $ 28-47 City $ 4862
StateProv $ 63-64 PostalCode $ 67-73 Country $ ;
datalines;
1001
27514

Ericson, Jane
USA

1002
Dix, Martin
3E8 Canada

111 Clancey Court

Chapel Hill

NC

4 Shepherd St.

Vancouver

BC

1003
00196

Gabrielli, Theresa Via Pisanelli, 25


Italy

Roma

1004
94124

Clayton, Aria
USA

14 Bridge St.

San Francisco

CA

1005
87429

Archuleta, Ruby
USA

Box 108

Milagro

NM

1006
53704

Misiewicz, Jeremy
USA

43-C Lakeview Apts. Madison

WI

1007
75019

Ahmadi, Hafez
France

52 Rue Marston

Paris

1008
32312

Jacobson, Becky
USA

1 Lincoln St.

Tallahassee

FL

1009
An, Ing
2T3 Canada

95 Willow Dr.

Toronto

ON

1010
17407

1009 Cherry St.

York

PA

Slater, Emily
USA

;
proc print data=mail_list;
title 'Magazine Master Mailing List';
run;

data mail_trans;

V6C

M5J

infile datalines missover;


input SubscriberId 1-8 Name $ 9-27 StreetAddress $ 28-47 City $ 4862
StateProv $ 63-64 PostalCode $ 67-73 Country $ 75-80;
datalines;
1002

Dix-Rosen, Martin

1001
27516
1006

932 Webster St.

1009
4H2

2540 Pleasant St.

Calgary

AB

28 Morningside Dr.

New York

NY

P.O. Box 1850

Seattle

WA

1011
10017

Mitchell, Wayne
USA

1002
98101

USA

1012
01075

Stavros, Gloria
USA

212 Northampton Rd. South Hadley

run;

proc sort data=mail_trans;


by SubscriberId;
run;
proc print data=mail_trans;
title 'Magazine Mailing List Changes';
title2 '(for current month)';
run;

data mail_newlist;
update mail_list mail_trans;
by SubscriberId;
run;

proc print data=mail_newlist;

MA

T2P

title 'Magazine Mailing List';


title2 '(updated for current month)';
run;

Magazine Master Mailing List


Obs SubscriberId Name

StreetAddress

City

StateProv PostalCode Country

1001 Ericson,
Jane

111 Clancey
Court

Chapel Hill

NC

27514

USA

1002 Dix, Martin

4 Shepherd St.

Vancouver

BC

V6C 3E8

Canada

1003 Gabrielli,
Theresa

Via Pisanelli, 25

Roma

00196

Italy

1004 Clayton,
Aria

14 Bridge St.

San
Francisco

CA

94124

USA

1005 Archuleta,
Ruby

Box 108

Milagro

NM

87429

USA

1006 Misiewicz,
Jeremy

43-C Lakeview
Apts.

Madison

WI

53704

USA

1007 Ahmadi,
Hafez

52 Rue Marston

Paris

75019

France

1008 Jacobson,
Becky

1 Lincoln St.

Tallahassee

FL

32312

USA

1009 An, Ing

95 Willow Dr.

Toronto

ON

M5J 2T3

Canada

10

1010 Slater,
Emily

1009 Cherry St.

York

PA

17407

USA

Magazine Mailing List Changes


(for current month)
Obs SubscriberId Name

StreetAddress

1001

1002 Dix-Rosen,
Martin

1002

P.O. Box 1850

1006

932 Webster St.

1009

City

StateProv PostalCode Country


27516

Seattle

WA

98101

USA

2540 Pleasant
St.

Calgary

AB

T2P 4H2

1011 Mitchell,
Wayne

28 Morningside
Dr.

New York

NY

10017

USA

1012 Stavros,
Gloria

212 Northampton
Rd.

South
Hadley

MA

01075

USA

Magazine Mailing List


(updated for current month)
Obs SubscriberId Name

StreetAddress

City

StateProv PostalCode Country

1001 Ericson,
Jane

111 Clancey
Court

Chapel Hill

NC

27516

USA

1002 Dix-Rosen,
Martin

P.O. Box 1850

Seattle

WA

98101

USA

1003 Gabrielli,
Theresa

Via Pisanelli, 25

Roma

00196

Italy

1004 Clayton,
Aria

14 Bridge St.

San
Francisco

CA

94124

USA

1005 Archuleta,
Ruby

Box 108

Milagro

NM

87429

USA

1006 Misiewicz,
Jeremy

932 Webster St.

Madison

WI

53704

USA

1007 Ahmadi,
Hafez

52 Rue Marston

Paris

75019

France

1008 Jacobson,
Becky

1 Lincoln St.

Tallahassee

FL

32312

USA

1009 An, Ing

2540 Pleasant
St.

Calgary

AB

T2P 4H2

Canada

10

1010 Slater,

1009 Cherry St.

York

PA

17407

USA

Obs SubscriberId Name

StreetAddress

City

StateProv PostalCode Country

Emily
11

1011 Mitchell,
Wayne

28 Morningside
Dr.

New York

NY

10017

USA

12

1012 Stavros,
Gloria

212
Northampton
Rd.

South
Hadley

MA

01075

USA

You might also like