Populating missing values following update

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Populating missing values following update

Hello everyone. I would like to be able to populate latitude and longitude values for multiple rows of the same


address in a data file. I ran the following code:


data file1

update masterfile transfile;

by address;

run;


I received the following:

address latitude longitude

1 smith st. -74.345 40.345

1 smith st. .              .

1 smith st  .              .


I would like to see the latitude and longitude values entered for each address after the first line of each new

address. 


Thank you


Accepted Solutions
Solution
‎08-31-2012 09:29 PM
Super Contributor
Posts: 1,636

Re: Populating missing values following update

try:

data file1

merge  masterfile transfile;

by address;

run;

View solution in original post


All Replies
Solution
‎08-31-2012 09:29 PM
Super Contributor
Posts: 1,636

Re: Populating missing values following update

try:

data file1

merge  masterfile transfile;

by address;

run;

New Contributor
Posts: 2

Re: Populating missing values following update

Linlin,

Thank you for a prompt and simple fix.  I can't believe that I overlooked the merge statement.

dh

Respected Advisor
Posts: 3,156

Re: Populating missing values following update

I have seen this from data _null_'s post, please note the difference, the update statement can still do the trick:

data file1

update transfile masterfile;

by address;

output;

run;



note: two tables will have to share the same address, otherwise, the final table will be missing the ones that are existing in masterfile. 

Haikuo

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 231 views
  • 0 likes
  • 3 in conversation