Valid in: | DATA step |
Category: | Action |
Type: | Executable |
Restriction: | Use only with a MODIFY statement. |
data master; input FirstName $ id $ PhoneNumber; datalines; Kevin ABCjkh 904 Sandi defsns 905 Terry ghitDP 951 Jason jklJWM 962 ; data trans; input FirstName $ id $ PhoneNumber; datalines; . ABCjkh 2904 . defsns 2905 Madeline mnombt 2983 ; data master; modify master trans; by id; /* obs found in master */ /* change info, replace */ if _iorc_ = %sysrc(_sok) then replace; /* obs not in master */ else if _iorc_ = %sysrc(_dsenmr) then do; /* reset _error_ */ _error_=0; /* reset _iorc_ */ _iorc_=0; /* output obs to master */ output; end; run; proc print data=master; title 'MASTER with New Phone Numbers'; run;