Sample 24568: Allow missing values from transaction data set to update master data set
Overlay values in master data set with values from
the transaction data set, including missings.
Note:
Update works with two data sets only. The data
needs to be in sort order, or indexed.
Specify the option UPDATEMODE= to indicate that
missing values can be used to update non-missing
values in the master data set.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
/* Create sample data */
data master(index=(name));
input name $1-16 dept $17-20 @21 ext;
datalines;
Lawrence Pauley TMF 1234
Ling Tan PCS 7841
Hargis Flom TDA .
;
data transaction;
infile datalines dlm=',' dsd;
input name :$16. dept :$3. ext;
datalines;
Arlene Wilkes,UNX,4500
Hargis Flom,.,.
Ling Tan,UNX,7841
;
data new;
update master transaction updatemode=nomissingcheck;
by name;
run;
proc print;
run;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
Obs name dept ext
1 Arlene Wilkes UNX 4500
2 Hargis Flom .
3 Lawrence Pauley TMF 1234
4 Ling Tan UNX 7841
Overlay values in master data set with values from the transaction data set, including missings.
| Type: | Sample |
| Topic: | SAS Reference ==> DATA Step SAS Reference ==> Statements ==> File-handling ==> UPDATE
|
| Date Modified: | 2005-12-08 11:34:04 |
| Date Created: | 2004-09-30 14:08:54 |
Operating System and Release Information
| SAS System | Base SAS | All | 8 TS M0 | n/a |